﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.CommandBuffer
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine.Bindings;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Profiling;
using UnityEngine.Rendering.RendererUtils;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>List of graphics commands to execute.</para>
  /// </summary>
  [UsedByNativeCode]
  [NativeHeader("Runtime/Shaders/RayTracingShader.h")]
  [NativeHeader("Runtime/Shaders/ComputeShader.h")]
  [NativeType("Runtime/Graphics/CommandBuffer/RenderingCommandBuffer.h")]
  [NativeHeader("Runtime/Export/Graphics/RenderingCommandBuffer.bindings.h")]
  public class CommandBuffer : IDisposable
  {
    internal IntPtr m_Ptr;

    /// <summary>
    ///   <para>Adds a command to copy the pixel data from one texture, convert the data into a different format, and copy it into another texture.</para>
    /// </summary>
    /// <param name="src">The source texture. The texture must be a Texture2D or Cubemap.</param>
    /// <param name="dst">The destination texture. The texture must be a Texture2D, Texture2DArray, Cubemap, or CubemapArray. The texture must also be uncompressed and correspond to a supported RenderTextureFormat.</param>
    /// <param name="srcElement">The element in the source texture to copy from. Use CubemapFace if src is a Cubemap. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    public void ConvertTexture(RenderTargetIdentifier src, RenderTargetIdentifier dst)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.ConvertTexture_Internal(src, 0, dst, 0);
    }

    /// <summary>
    ///   <para>Adds a command to copy the pixel data from one texture, convert the data into a different format, and copy it into another texture.</para>
    /// </summary>
    /// <param name="src">The source texture. The texture must be a Texture2D or Cubemap.</param>
    /// <param name="dst">The destination texture. The texture must be a Texture2D, Texture2DArray, Cubemap, or CubemapArray. The texture must also be uncompressed and correspond to a supported RenderTextureFormat.</param>
    /// <param name="srcElement">The element in the source texture to copy from. Use CubemapFace if src is a Cubemap. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    public void ConvertTexture(
      RenderTargetIdentifier src,
      int srcElement,
      RenderTargetIdentifier dst,
      int dstElement)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.ConvertTexture_Internal(src, srcElement, dst, dstElement);
    }

    /// <summary>
    ///   <para>Adds an "AsyncGPUReadback.WaitAllRequests" command to the CommandBuffer.</para>
    /// </summary>
    [NativeMethod("AddWaitAllAsyncReadbackRequests")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void WaitAllAsyncReadbackRequests();

    public void RequestAsyncReadback(ComputeBuffer src, Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_1(src, callback);
    }

    public void RequestAsyncReadback(GraphicsBuffer src, Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_8(src, callback);
    }

    public void RequestAsyncReadback(
      ComputeBuffer src,
      int size,
      int offset,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_2(src, size, offset, callback);
    }

    public void RequestAsyncReadback(
      GraphicsBuffer src,
      int size,
      int offset,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_9(src, size, offset, callback);
    }

    public void RequestAsyncReadback(Texture src, Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_3(src, callback);
    }

    public void RequestAsyncReadback(
      Texture src,
      int mipIndex,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_4(src, mipIndex, callback);
    }

    public void RequestAsyncReadback(
      Texture src,
      int mipIndex,
      TextureFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_5(src, mipIndex, GraphicsFormatUtility.GetGraphicsFormat(dstFormat, QualitySettings.activeColorSpace == ColorSpace.Linear), callback);
    }

    public void RequestAsyncReadback(
      Texture src,
      int mipIndex,
      GraphicsFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_5(src, mipIndex, dstFormat, callback);
    }

    public void RequestAsyncReadback(
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_6(src, mipIndex, x, width, y, height, z, depth, callback);
    }

    public void RequestAsyncReadback(
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      TextureFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_7(src, mipIndex, x, width, y, height, z, depth, GraphicsFormatUtility.GetGraphicsFormat(dstFormat, QualitySettings.activeColorSpace == ColorSpace.Linear), callback);
    }

    public void RequestAsyncReadback(
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      GraphicsFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_RequestAsyncReadback_7(src, mipIndex, x, width, y, height, z, depth, dstFormat, callback);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      ComputeBuffer src,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_1(src, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      ComputeBuffer src,
      int size,
      int offset,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_2(src, size, offset, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      GraphicsBuffer src,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_8(src, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      GraphicsBuffer src,
      int size,
      int offset,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_9(src, size, offset, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      Texture src,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_3(src, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      Texture src,
      int mipIndex,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_4(src, mipIndex, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      Texture src,
      int mipIndex,
      TextureFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_5(src, mipIndex, GraphicsFormatUtility.GetGraphicsFormat(dstFormat, QualitySettings.activeColorSpace == ColorSpace.Linear), callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      Texture src,
      int mipIndex,
      GraphicsFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_5(src, mipIndex, dstFormat, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_6(src, mipIndex, x, width, y, height, z, depth, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      TextureFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_7(src, mipIndex, x, width, y, height, z, depth, GraphicsFormatUtility.GetGraphicsFormat(dstFormat, QualitySettings.activeColorSpace == ColorSpace.Linear), callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeArray<T>(
      ref NativeArray<T> output,
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      GraphicsFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_7(src, mipIndex, x, width, y, height, z, depth, dstFormat, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      ComputeBuffer src,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_1(src, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      ComputeBuffer src,
      int size,
      int offset,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_2(src, size, offset, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      GraphicsBuffer src,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_8(src, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      GraphicsBuffer src,
      int size,
      int offset,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_9(src, size, offset, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      Texture src,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_3(src, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      Texture src,
      int mipIndex,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_4(src, mipIndex, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      Texture src,
      int mipIndex,
      TextureFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_5(src, mipIndex, GraphicsFormatUtility.GetGraphicsFormat(dstFormat, QualitySettings.activeColorSpace == ColorSpace.Linear), callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      Texture src,
      int mipIndex,
      GraphicsFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_5(src, mipIndex, dstFormat, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_6(src, mipIndex, x, width, y, height, z, depth, callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      TextureFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_7(src, mipIndex, x, width, y, height, z, depth, GraphicsFormatUtility.GetGraphicsFormat(dstFormat, QualitySettings.activeColorSpace == ColorSpace.Linear), callback, &andCheckAccess);
    }

    public unsafe void RequestAsyncReadbackIntoNativeSlice<T>(
      ref NativeSlice<T> output,
      Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      GraphicsFormat dstFormat,
      Action<AsyncGPUReadbackRequest> callback)
      where T : struct
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      AsyncRequestNativeArrayData andCheckAccess = AsyncRequestNativeArrayData.CreateAndCheckAccess<T>(output);
      this.Internal_RequestAsyncReadback_7(src, mipIndex, x, width, y, height, z, depth, dstFormat, callback, &andCheckAccess);
    }

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_1(
      [NotNull("ArgumentNullException")] ComputeBuffer src,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_2(
      [NotNull("ArgumentNullException")] ComputeBuffer src,
      int size,
      int offset,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_3(
      [NotNull("ArgumentNullException")] Texture src,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_4(
      [NotNull("ArgumentNullException")] Texture src,
      int mipIndex,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_5(
      [NotNull("ArgumentNullException")] Texture src,
      int mipIndex,
      GraphicsFormat dstFormat,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_6(
      [NotNull("ArgumentNullException")] Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_7(
      [NotNull("ArgumentNullException")] Texture src,
      int mipIndex,
      int x,
      int width,
      int y,
      int height,
      int z,
      int depth,
      GraphicsFormat dstFormat,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_8(
      [NotNull("ArgumentNullException")] GraphicsBuffer src,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    [NativeMethod("AddRequestAsyncReadback")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern unsafe void Internal_RequestAsyncReadback_9(
      [NotNull("ArgumentNullException")] GraphicsBuffer src,
      int size,
      int offset,
      [NotNull("ArgumentNullException")] Action<AsyncGPUReadbackRequest> callback,
      AsyncRequestNativeArrayData* nativeArrayData = null);

    /// <summary>
    ///   <para>Add a "set invert culling" command to the buffer.</para>
    /// </summary>
    /// <param name="invertCulling">A boolean indicating whether to invert the backface culling (true) or not (false).</param>
    [NativeMethod("AddSetInvertCulling")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetInvertCulling(bool invertCulling);

    private void ConvertTexture_Internal(
      RenderTargetIdentifier src,
      int srcElement,
      RenderTargetIdentifier dst,
      int dstElement)
    {
      this.ConvertTexture_Internal_Injected(ref src, srcElement, ref dst, dstElement);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetSinglePassStereo", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetSinglePassStereo(SinglePassStereoMode mode);

    [FreeFunction("RenderingCommandBuffer_Bindings::InitBuffer")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern IntPtr InitBuffer();

    [FreeFunction("RenderingCommandBuffer_Bindings::CreateGPUFence_Internal", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern IntPtr CreateGPUFence_Internal(
      GraphicsFenceType fenceType,
      SynchronisationStageFlags stage);

    [FreeFunction("RenderingCommandBuffer_Bindings::WaitOnGPUFence_Internal", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void WaitOnGPUFence_Internal(IntPtr fencePtr, SynchronisationStageFlags stage);

    [FreeFunction("RenderingCommandBuffer_Bindings::ReleaseBuffer", HasExplicitThis = true, IsThreadSafe = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void ReleaseBuffer();

    /// <summary>
    ///   <para>Adds a command to set a float parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeFloatParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetComputeFloatParam([NotNull("ArgumentNullException")] ComputeShader computeShader, int nameID, float val);

    /// <summary>
    ///   <para>Adds a command to set an integer parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeIntParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetComputeIntParam([NotNull("ArgumentNullException")] ComputeShader computeShader, int nameID, int val);

    /// <summary>
    ///   <para>Adds a command to set a vector parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeVectorParam", HasExplicitThis = true)]
    public void SetComputeVectorParam([NotNull("ArgumentNullException")] ComputeShader computeShader, int nameID, Vector4 val)
    {
      this.SetComputeVectorParam_Injected(computeShader, nameID, ref val);
    }

    /// <summary>
    ///   <para>Adds a command to set a vector array parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Property name.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeVectorArrayParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetComputeVectorArrayParam(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int nameID,
      [Unmarshalled] Vector4[] values);

    /// <summary>
    ///   <para>Adds a command to set a matrix parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeMatrixParam", HasExplicitThis = true)]
    public void SetComputeMatrixParam([NotNull("ArgumentNullException")] ComputeShader computeShader, int nameID, Matrix4x4 val)
    {
      this.SetComputeMatrixParam_Injected(computeShader, nameID, ref val);
    }

    /// <summary>
    ///   <para>Adds a command to set a matrix array parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeMatrixArrayParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetComputeMatrixArrayParam(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int nameID,
      [Unmarshalled] Matrix4x4[] values);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetComputeFloats", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetComputeFloats(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int nameID,
      [Unmarshalled] float[] values);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetComputeInts", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetComputeInts(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int nameID,
      [Unmarshalled] int[] values);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetComputeTextureParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetComputeTextureParam(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      ref RenderTargetIdentifier rt,
      int mipLevel,
      RenderTextureSubElement element);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeBufferParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetComputeBufferParam(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      ComputeBuffer buffer);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeBufferParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetComputeGraphicsBufferParam(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      GraphicsBuffer buffer);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeConstantBufferParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetComputeConstantComputeBufferParam(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int nameID,
      ComputeBuffer buffer,
      int offset,
      int size);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeConstantBufferParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetComputeConstantGraphicsBufferParam(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int nameID,
      GraphicsBuffer buffer,
      int offset,
      int size);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DispatchCompute", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DispatchCompute(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int kernelIndex,
      int threadGroupsX,
      int threadGroupsY,
      int threadGroupsZ);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DispatchComputeIndirect", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DispatchComputeIndirect(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int kernelIndex,
      ComputeBuffer indirectBuffer,
      uint argsOffset);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DispatchComputeIndirect", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DispatchComputeIndirectGraphicsBuffer(
      [NotNull("ArgumentNullException")] ComputeShader computeShader,
      int kernelIndex,
      GraphicsBuffer indirectBuffer,
      uint argsOffset);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingBufferParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingBufferParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      ComputeBuffer buffer);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingConstantBufferParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingConstantComputeBufferParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      ComputeBuffer buffer,
      int offset,
      int size);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingConstantBufferParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingConstantGraphicsBufferParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      GraphicsBuffer buffer,
      int offset,
      int size);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingTextureParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingTextureParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      ref RenderTargetIdentifier rt);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingFloatParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingFloatParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      float val);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingIntParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingIntParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      int val);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingVectorParam", HasExplicitThis = true)]
    private void Internal_SetRayTracingVectorParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      Vector4 val)
    {
      this.Internal_SetRayTracingVectorParam_Injected(rayTracingShader, nameID, ref val);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingVectorArrayParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingVectorArrayParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      [Unmarshalled] Vector4[] values);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingMatrixParam", HasExplicitThis = true)]
    private void Internal_SetRayTracingMatrixParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      Matrix4x4 val)
    {
      this.Internal_SetRayTracingMatrixParam_Injected(rayTracingShader, nameID, ref val);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingMatrixArrayParam", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingMatrixArrayParam(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      [Unmarshalled] Matrix4x4[] values);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingFloats", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingFloats(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      [Unmarshalled] float[] values);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingInts", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingInts(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      [Unmarshalled] int[] values);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_BuildRayTracingAccelerationStructure", HasExplicitThis = true)]
    private void Internal_BuildRayTracingAccelerationStructure(
      [NotNull("ArgumentNullException")] RayTracingAccelerationStructure accelerationStructure,
      Vector3 relativeOrigin)
    {
      this.Internal_BuildRayTracingAccelerationStructure_Injected(accelerationStructure, ref relativeOrigin);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_SetRayTracingAccelerationStructure", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingAccelerationStructure(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      int nameID,
      RayTracingAccelerationStructure accelerationStructure);

    /// <summary>
    ///   <para>Adds a command to select which Shader Pass to use when executing ray/geometry intersection shaders.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="passName">The Shader Pass to use when executing ray tracing shaders.</param>
    [NativeMethod("AddSetRayTracingShaderPass")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetRayTracingShaderPass([NotNull("ArgumentNullException")] RayTracingShader rayTracingShader, string passName);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DispatchRays", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DispatchRays(
      [NotNull("ArgumentNullException")] RayTracingShader rayTracingShader,
      string rayGenShaderName,
      uint width,
      uint height,
      uint depth,
      Camera camera = null);

    [NativeMethod("AddGenerateMips")]
    private void Internal_GenerateMips(RenderTargetIdentifier rt)
    {
      this.Internal_GenerateMips_Injected(ref rt);
    }

    [NativeMethod("AddResolveAntiAliasedSurface")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_ResolveAntiAliasedSurface(RenderTexture rt, RenderTexture target);

    [NativeMethod("AddCopyCounterValue")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void CopyCounterValueCC(
      ComputeBuffer src,
      ComputeBuffer dst,
      uint dstOffsetBytes);

    [NativeMethod("AddCopyCounterValue")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void CopyCounterValueGC(
      GraphicsBuffer src,
      ComputeBuffer dst,
      uint dstOffsetBytes);

    [NativeMethod("AddCopyCounterValue")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void CopyCounterValueCG(
      ComputeBuffer src,
      GraphicsBuffer dst,
      uint dstOffsetBytes);

    [NativeMethod("AddCopyCounterValue")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void CopyCounterValueGG(
      GraphicsBuffer src,
      GraphicsBuffer dst,
      uint dstOffsetBytes);

    /// <summary>
    ///   <para>Name of this command buffer.</para>
    /// </summary>
    public extern string name { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Size of this command buffer in bytes (Read Only).</para>
    /// </summary>
    public extern int sizeInBytes { [NativeMethod("GetBufferSize"), MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Clear all commands in the buffer.</para>
    /// </summary>
    [NativeMethod("ClearCommands")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void Clear();

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawMesh", HasExplicitThis = true)]
    private void Internal_DrawMesh(
      [NotNull("ArgumentNullException")] Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int submeshIndex,
      int shaderPass,
      MaterialPropertyBlock properties)
    {
      this.Internal_DrawMesh_Injected(mesh, ref matrix, material, submeshIndex, shaderPass, properties);
    }

    [NativeMethod("AddDrawRenderer")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawRenderer(
      [NotNull("ArgumentNullException")] Renderer renderer,
      Material material,
      int submeshIndex,
      int shaderPass);

    [NativeMethod("AddDrawRendererList")]
    private void Internal_DrawRendererList(RendererList rendererList)
    {
      this.Internal_DrawRendererList_Injected(ref rendererList);
    }

    private void Internal_DrawRenderer(Renderer renderer, Material material, int submeshIndex)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_DrawRenderer(renderer, material, submeshIndex, -1);
    }

    private void Internal_DrawRenderer(Renderer renderer, Material material)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_DrawRenderer(renderer, material, 0);
    }

    [NativeMethod("AddDrawProcedural")]
    private void Internal_DrawProcedural(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int vertexCount,
      int instanceCount,
      MaterialPropertyBlock properties)
    {
      this.Internal_DrawProcedural_Injected(ref matrix, material, shaderPass, topology, vertexCount, instanceCount, properties);
    }

    [NativeMethod("AddDrawProceduralIndexed")]
    private void Internal_DrawProceduralIndexed(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int indexCount,
      int instanceCount,
      MaterialPropertyBlock properties)
    {
      this.Internal_DrawProceduralIndexed_Injected(indexBuffer, ref matrix, material, shaderPass, topology, indexCount, instanceCount, properties);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawProceduralIndirect", HasExplicitThis = true)]
    private void Internal_DrawProceduralIndirect(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      this.Internal_DrawProceduralIndirect_Injected(ref matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawProceduralIndexedIndirect", HasExplicitThis = true)]
    private void Internal_DrawProceduralIndexedIndirect(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      this.Internal_DrawProceduralIndexedIndirect_Injected(indexBuffer, ref matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawProceduralIndirect", HasExplicitThis = true)]
    private void Internal_DrawProceduralIndirectGraphicsBuffer(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      this.Internal_DrawProceduralIndirectGraphicsBuffer_Injected(ref matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawProceduralIndexedIndirect", HasExplicitThis = true)]
    private void Internal_DrawProceduralIndexedIndirectGraphicsBuffer(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      this.Internal_DrawProceduralIndexedIndirectGraphicsBuffer_Injected(indexBuffer, ref matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawMeshInstanced", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      [Unmarshalled] Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawMeshInstancedProcedural", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawMeshInstancedProcedural(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      int count,
      MaterialPropertyBlock properties);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawMeshInstancedIndirect", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawMeshInstancedIndirect", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawMeshInstancedIndirectGraphicsBuffer(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties);

    [FreeFunction("RenderingCommandBuffer_Bindings::Internal_DrawOcclusionMesh", HasExplicitThis = true)]
    private void Internal_DrawOcclusionMesh(RectInt normalizedCamViewport)
    {
      this.Internal_DrawOcclusionMesh_Injected(ref normalizedCamViewport);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::SetRandomWriteTarget_Texture", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRandomWriteTarget_Texture(int index, ref RenderTargetIdentifier rt);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetRandomWriteTarget_Buffer", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRandomWriteTarget_Buffer(
      int index,
      ComputeBuffer uav,
      bool preserveCounterValue);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetRandomWriteTarget_Buffer", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRandomWriteTarget_GraphicsBuffer(
      int index,
      GraphicsBuffer uav,
      bool preserveCounterValue);

    /// <summary>
    ///   <para>Clear random write targets for level pixel shaders.</para>
    /// </summary>
    [FreeFunction("RenderingCommandBuffer_Bindings::ClearRandomWriteTargets", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void ClearRandomWriteTargets();

    /// <summary>
    ///   <para>Add a command to set the rendering viewport.</para>
    /// </summary>
    /// <param name="pixelRect">Viewport rectangle in pixel coordinates.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetViewport", HasExplicitThis = true, ThrowsException = true)]
    public void SetViewport(Rect pixelRect) => this.SetViewport_Injected(ref pixelRect);

    /// <summary>
    ///   <para>Add a command to enable the hardware scissor rectangle.</para>
    /// </summary>
    /// <param name="scissor">Viewport rectangle in pixel coordinates.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::EnableScissorRect", HasExplicitThis = true, ThrowsException = true)]
    public void EnableScissorRect(Rect scissor) => this.EnableScissorRect_Injected(ref scissor);

    /// <summary>
    ///   <para>Add a command to disable the hardware scissor rectangle.</para>
    /// </summary>
    [FreeFunction("RenderingCommandBuffer_Bindings::DisableScissorRect", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void DisableScissorRect();

    [FreeFunction("RenderingCommandBuffer_Bindings::CopyTexture_Internal", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void CopyTexture_Internal(
      ref RenderTargetIdentifier src,
      int srcElement,
      int srcMip,
      int srcX,
      int srcY,
      int srcWidth,
      int srcHeight,
      ref RenderTargetIdentifier dst,
      int dstElement,
      int dstMip,
      int dstX,
      int dstY,
      int mode);

    [FreeFunction("RenderingCommandBuffer_Bindings::Blit_Texture", HasExplicitThis = true)]
    private void Blit_Texture(
      Texture source,
      ref RenderTargetIdentifier dest,
      Material mat,
      int pass,
      Vector2 scale,
      Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice)
    {
      this.Blit_Texture_Injected(source, ref dest, mat, pass, ref scale, ref offset, sourceDepthSlice, destDepthSlice);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::Blit_Identifier", HasExplicitThis = true)]
    private void Blit_Identifier(
      ref RenderTargetIdentifier source,
      ref RenderTargetIdentifier dest,
      Material mat,
      int pass,
      Vector2 scale,
      Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice)
    {
      this.Blit_Identifier_Injected(ref source, ref dest, mat, pass, ref scale, ref offset, sourceDepthSlice, destDepthSlice);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::GetTemporaryRT", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format,
      int antiAliasing,
      bool enableRandomWrite,
      RenderTextureMemoryless memorylessMode,
      bool useDynamicScale);

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format,
      int antiAliasing,
      bool enableRandomWrite,
      RenderTextureMemoryless memorylessMode)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, antiAliasing, enableRandomWrite, memorylessMode, false);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format,
      int antiAliasing,
      bool enableRandomWrite)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, antiAliasing, enableRandomWrite, RenderTextureMemoryless.None);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format,
      int antiAliasing)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, antiAliasing, false, RenderTextureMemoryless.None);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, 1);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite,
      int antiAliasing,
      bool enableRandomWrite,
      RenderTextureMemoryless memorylessMode,
      bool useDynamicScale)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, GraphicsFormatUtility.GetGraphicsFormat(format, readWrite), antiAliasing, enableRandomWrite, memorylessMode, useDynamicScale);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite,
      int antiAliasing,
      bool enableRandomWrite,
      RenderTextureMemoryless memorylessMode)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, readWrite, antiAliasing, enableRandomWrite, memorylessMode, false);
    }

    /// <summary>
    ///   <para>Add a "get a temporary render texture" command.</para>
    /// </summary>
    /// <param name="nameID">Shader property name for this texture.</param>
    /// <param name="width">Width in pixels, or -1 for "camera pixel width".</param>
    /// <param name="height">Height in pixels, or -1 for "camera pixel height".</param>
    /// <param name="depthBuffer">Depth buffer bits (0, 16 or 24).</param>
    /// <param name="filter">Texture filtering mode (default is Point).</param>
    /// <param name="format">Format of the render texture (default is ARGB32).</param>
    /// <param name="readWrite">Color space conversion mode.</param>
    /// <param name="antiAliasing">Anti-aliasing (default is no anti-aliasing).</param>
    /// <param name="enableRandomWrite">Should random-write access into the texture be enabled (default is false).</param>
    /// <param name="desc">Use this RenderTextureDescriptor for the settings when creating the temporary RenderTexture.</param>
    /// <param name="memorylessMode">Render texture memoryless mode.</param>
    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite,
      int antiAliasing,
      bool enableRandomWrite)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, readWrite, antiAliasing, enableRandomWrite, RenderTextureMemoryless.None);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite,
      int antiAliasing)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, readWrite, antiAliasing, false);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, format, readWrite, 1);
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, GraphicsFormatUtility.GetGraphicsFormat(format, RenderTextureReadWrite.Default));
    }

    public void GetTemporaryRT(
      int nameID,
      int width,
      int height,
      int depthBuffer,
      FilterMode filter)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, filter, SystemInfo.GetGraphicsFormat(DefaultFormat.LDR));
    }

    public void GetTemporaryRT(int nameID, int width, int height, int depthBuffer)
    {
      this.GetTemporaryRT(nameID, width, height, depthBuffer, FilterMode.Point);
    }

    public void GetTemporaryRT(int nameID, int width, int height)
    {
      this.GetTemporaryRT(nameID, width, height, 0);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::GetTemporaryRTWithDescriptor", HasExplicitThis = true)]
    private void GetTemporaryRTWithDescriptor(
      int nameID,
      RenderTextureDescriptor desc,
      FilterMode filter)
    {
      this.GetTemporaryRTWithDescriptor_Injected(nameID, ref desc, filter);
    }

    /// <summary>
    ///   <para>Add a "get a temporary render texture" command.</para>
    /// </summary>
    /// <param name="nameID">Shader property name for this texture.</param>
    /// <param name="width">Width in pixels, or -1 for "camera pixel width".</param>
    /// <param name="height">Height in pixels, or -1 for "camera pixel height".</param>
    /// <param name="depthBuffer">Depth buffer bits (0, 16 or 24).</param>
    /// <param name="filter">Texture filtering mode (default is Point).</param>
    /// <param name="format">Format of the render texture (default is ARGB32).</param>
    /// <param name="readWrite">Color space conversion mode.</param>
    /// <param name="antiAliasing">Anti-aliasing (default is no anti-aliasing).</param>
    /// <param name="enableRandomWrite">Should random-write access into the texture be enabled (default is false).</param>
    /// <param name="desc">Use this RenderTextureDescriptor for the settings when creating the temporary RenderTexture.</param>
    /// <param name="memorylessMode">Render texture memoryless mode.</param>
    public void GetTemporaryRT(int nameID, RenderTextureDescriptor desc, FilterMode filter)
    {
      this.GetTemporaryRTWithDescriptor(nameID, desc, filter);
    }

    public void GetTemporaryRT(int nameID, RenderTextureDescriptor desc)
    {
      this.GetTemporaryRT(nameID, desc, FilterMode.Point);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::GetTemporaryRTArray", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format,
      int antiAliasing,
      bool enableRandomWrite,
      bool useDynamicScale);

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format,
      int antiAliasing,
      bool enableRandomWrite)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, format, antiAliasing, enableRandomWrite, false);
    }

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format,
      int antiAliasing)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, format, antiAliasing, false);
    }

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      GraphicsFormat format)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, format, 1);
    }

    /// <summary>
    ///   <para>Add a "get a temporary render texture array" command.</para>
    /// </summary>
    /// <param name="nameID">Shader property name for this texture.</param>
    /// <param name="width">Width in pixels, or -1 for "camera pixel width".</param>
    /// <param name="height">Height in pixels, or -1 for "camera pixel height".</param>
    /// <param name="slices">Number of slices in texture array.</param>
    /// <param name="depthBuffer">Depth buffer bits (0, 16 or 24).</param>
    /// <param name="filter">Texture filtering mode (default is Point).</param>
    /// <param name="format">Format of the render texture (default is ARGB32).</param>
    /// <param name="readWrite">Color space conversion mode.</param>
    /// <param name="antiAliasing">Anti-aliasing (default is no anti-aliasing).</param>
    /// <param name="enableRandomWrite">Should random-write access into the texture be enabled (default is false).</param>
    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite,
      int antiAliasing,
      bool enableRandomWrite)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, GraphicsFormatUtility.GetGraphicsFormat(format, readWrite), antiAliasing, enableRandomWrite, false);
    }

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite,
      int antiAliasing)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, GraphicsFormatUtility.GetGraphicsFormat(format, readWrite), antiAliasing, false);
    }

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format,
      RenderTextureReadWrite readWrite)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, GraphicsFormatUtility.GetGraphicsFormat(format, readWrite), 1, false);
    }

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter,
      RenderTextureFormat format)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, GraphicsFormatUtility.GetGraphicsFormat(format, RenderTextureReadWrite.Default), 1, false);
    }

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer,
      FilterMode filter)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, filter, SystemInfo.GetGraphicsFormat(DefaultFormat.LDR), 1, false);
    }

    public void GetTemporaryRTArray(
      int nameID,
      int width,
      int height,
      int slices,
      int depthBuffer)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, depthBuffer, FilterMode.Point);
    }

    public void GetTemporaryRTArray(int nameID, int width, int height, int slices)
    {
      this.GetTemporaryRTArray(nameID, width, height, slices, 0);
    }

    /// <summary>
    ///   <para>Add a "release a temporary render texture" command.</para>
    /// </summary>
    /// <param name="nameID">Shader property name for this texture.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::ReleaseTemporaryRT", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void ReleaseTemporaryRT(int nameID);

    /// <summary>
    ///   <para>Adds a "clear render target" command.</para>
    /// </summary>
    /// <param name="clearDepth">Whether to clear both the depth buffer and the stencil buffer.</param>
    /// <param name="clearColor">Whether to clear the color buffer.</param>
    /// <param name="clearFlags">Which render targets to clear, defined using a bitwise OR combination of RTClearFlags values.</param>
    /// <param name="backgroundColor">Color to clear with.</param>
    /// <param name="depth">Depth to clear with (default is 1.0).</param>
    /// <param name="stencil">Stencil to clear with (default is 0).</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::ClearRenderTarget", HasExplicitThis = true)]
    public void ClearRenderTarget(
      RTClearFlags clearFlags,
      Color backgroundColor,
      float depth,
      uint stencil)
    {
      this.ClearRenderTarget_Injected(clearFlags, ref backgroundColor, depth, stencil);
    }

    public void ClearRenderTarget(bool clearDepth, bool clearColor, Color backgroundColor)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.ClearRenderTarget((RTClearFlags) ((clearColor ? 1 : 0) | (clearDepth ? 6 : 0)), backgroundColor, 1f, 0U);
    }

    /// <summary>
    ///   <para>Adds a "clear render target" command.</para>
    /// </summary>
    /// <param name="clearDepth">Whether to clear both the depth buffer and the stencil buffer.</param>
    /// <param name="clearColor">Whether to clear the color buffer.</param>
    /// <param name="clearFlags">Which render targets to clear, defined using a bitwise OR combination of RTClearFlags values.</param>
    /// <param name="backgroundColor">Color to clear with.</param>
    /// <param name="depth">Depth to clear with (default is 1.0).</param>
    /// <param name="stencil">Stencil to clear with (default is 0).</param>
    public void ClearRenderTarget(
      bool clearDepth,
      bool clearColor,
      Color backgroundColor,
      float depth)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.ClearRenderTarget((RTClearFlags) ((clearColor ? 1 : 0) | (clearDepth ? 6 : 0)), backgroundColor, depth, 0U);
    }

    /// <summary>
    ///   <para>Add a "set global shader float property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalFloat", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetGlobalFloat(int nameID, float value);

    /// <summary>
    ///   <para>Adds a command to set the value of a given property for all Shaders, where the property has a type of Int in ShaderLab code.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalInt", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetGlobalInt(int nameID, int value);

    /// <summary>
    ///   <para>Adds a command to set the value of a given property for all Shaders, where the property is an integer.</para>
    /// </summary>
    /// <param name="nameID"></param>
    /// <param name="value"></param>
    /// <param name="name"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalInteger", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetGlobalInteger(int nameID, int value);

    /// <summary>
    ///   <para>Add a "set global shader vector property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalVector", HasExplicitThis = true)]
    public void SetGlobalVector(int nameID, Vector4 value)
    {
      this.SetGlobalVector_Injected(nameID, ref value);
    }

    /// <summary>
    ///   <para>Add a "set global shader color property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalColor", HasExplicitThis = true)]
    public void SetGlobalColor(int nameID, Color value)
    {
      this.SetGlobalColor_Injected(nameID, ref value);
    }

    /// <summary>
    ///   <para>Add a "set global shader matrix property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalMatrix", HasExplicitThis = true)]
    public void SetGlobalMatrix(int nameID, Matrix4x4 value)
    {
      this.SetGlobalMatrix_Injected(nameID, ref value);
    }

    /// <summary>
    ///   <para>Adds a command to enable a global keyword with a given name.</para>
    /// </summary>
    /// <param name="keyword">Name of a global shader keyword to enable.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::EnableShaderKeyword", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void EnableShaderKeyword(string keyword);

    [FreeFunction("RenderingCommandBuffer_Bindings::EnableShaderKeyword", HasExplicitThis = true)]
    private void EnableGlobalKeyword(GlobalKeyword keyword)
    {
      this.EnableGlobalKeyword_Injected(ref keyword);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::EnableMaterialKeyword", HasExplicitThis = true)]
    private void EnableMaterialKeyword(Material material, LocalKeyword keyword)
    {
      this.EnableMaterialKeyword_Injected(material, ref keyword);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::EnableComputeKeyword", HasExplicitThis = true)]
    private void EnableComputeKeyword(ComputeShader computeShader, LocalKeyword keyword)
    {
      this.EnableComputeKeyword_Injected(computeShader, ref keyword);
    }

    public void EnableKeyword(in GlobalKeyword keyword) => this.EnableGlobalKeyword(keyword);

    public void EnableKeyword(Material material, in LocalKeyword keyword)
    {
      this.EnableMaterialKeyword(material, keyword);
    }

    public void EnableKeyword(ComputeShader computeShader, in LocalKeyword keyword)
    {
      this.EnableComputeKeyword(computeShader, keyword);
    }

    /// <summary>
    ///   <para>Adds a command to disable a global shader keyword with a given name.</para>
    /// </summary>
    /// <param name="keyword">Name of a global keyword to disable.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::DisableShaderKeyword", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void DisableShaderKeyword(string keyword);

    [FreeFunction("RenderingCommandBuffer_Bindings::DisableShaderKeyword", HasExplicitThis = true)]
    private void DisableGlobalKeyword(GlobalKeyword keyword)
    {
      this.DisableGlobalKeyword_Injected(ref keyword);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::DisableMaterialKeyword", HasExplicitThis = true)]
    private void DisableMaterialKeyword(Material material, LocalKeyword keyword)
    {
      this.DisableMaterialKeyword_Injected(material, ref keyword);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::DisableComputeKeyword", HasExplicitThis = true)]
    private void DisableComputeKeyword(ComputeShader computeShader, LocalKeyword keyword)
    {
      this.DisableComputeKeyword_Injected(computeShader, ref keyword);
    }

    public void DisableKeyword(in GlobalKeyword keyword) => this.DisableGlobalKeyword(keyword);

    public void DisableKeyword(Material material, in LocalKeyword keyword)
    {
      this.DisableMaterialKeyword(material, keyword);
    }

    public void DisableKeyword(ComputeShader computeShader, in LocalKeyword keyword)
    {
      this.DisableComputeKeyword(computeShader, keyword);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::SetShaderKeyword", HasExplicitThis = true)]
    private void SetGlobalKeyword(GlobalKeyword keyword, bool value)
    {
      this.SetGlobalKeyword_Injected(ref keyword, value);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::SetMaterialKeyword", HasExplicitThis = true)]
    private void SetMaterialKeyword(Material material, LocalKeyword keyword, bool value)
    {
      this.SetMaterialKeyword_Injected(material, ref keyword, value);
    }

    [FreeFunction("RenderingCommandBuffer_Bindings::SetComputeKeyword", HasExplicitThis = true)]
    private void SetComputeKeyword(ComputeShader computeShader, LocalKeyword keyword, bool value)
    {
      this.SetComputeKeyword_Injected(computeShader, ref keyword, value);
    }

    public void SetKeyword(in GlobalKeyword keyword, bool value)
    {
      this.SetGlobalKeyword(keyword, value);
    }

    public void SetKeyword(Material material, in LocalKeyword keyword, bool value)
    {
      this.SetMaterialKeyword(material, keyword, value);
    }

    public void SetKeyword(ComputeShader computeShader, in LocalKeyword keyword, bool value)
    {
      this.SetComputeKeyword(computeShader, keyword, value);
    }

    /// <summary>
    ///   <para>Add a command to set the view matrix.</para>
    /// </summary>
    /// <param name="view">View (world to camera space) matrix.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetViewMatrix", HasExplicitThis = true, ThrowsException = true)]
    public void SetViewMatrix(Matrix4x4 view) => this.SetViewMatrix_Injected(ref view);

    /// <summary>
    ///   <para>Add a command to set the projection matrix.</para>
    /// </summary>
    /// <param name="proj">Projection (camera to clip space) matrix.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetProjectionMatrix", HasExplicitThis = true, ThrowsException = true)]
    public void SetProjectionMatrix(Matrix4x4 proj) => this.SetProjectionMatrix_Injected(ref proj);

    /// <summary>
    ///   <para>Add a command to set the view and projection matrices.</para>
    /// </summary>
    /// <param name="view">View (world to camera space) matrix.</param>
    /// <param name="proj">Projection (camera to clip space) matrix.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetViewProjectionMatrices", HasExplicitThis = true, ThrowsException = true)]
    public void SetViewProjectionMatrices(Matrix4x4 view, Matrix4x4 proj)
    {
      this.SetViewProjectionMatrices_Injected(ref view, ref proj);
    }

    /// <summary>
    ///   <para>Adds a command to set the global depth bias.</para>
    /// </summary>
    /// <param name="bias">Scales the GPU's minimum resolvable depth buffer value to produce a constant depth offset. The minimum resolvable depth buffer value varies by device.
    /// 
    /// Set to a negative value to draw geometry closer to the camera, or a positive value to draw geometry further away from the camera.</param>
    /// <param name="slopeBias">Scales the maximum Z slope, also called the depth slope, to produce a variable depth offset for each polygon.
    /// 
    /// Polygons that are not parallel to the near and far clip planes have Z slope. Adjust this value to avoid visual artifacts on such polygons.</param>
    [NativeMethod("AddSetGlobalDepthBias")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetGlobalDepthBias(float bias, float slopeBias);

    /// <summary>
    ///   <para>Set flags describing the intention for how the command buffer will be executed.</para>
    /// </summary>
    /// <param name="flags">The flags to set.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetExecutionFlags", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetExecutionFlags(CommandBufferExecutionFlags flags);

    [FreeFunction("RenderingCommandBuffer_Bindings::ValidateAgainstExecutionFlags", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern bool ValidateAgainstExecutionFlags(
      CommandBufferExecutionFlags requiredFlags,
      CommandBufferExecutionFlags invalidFlags);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalFloatArrayListImpl", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalFloatArrayListImpl(int nameID, object values);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalVectorArrayListImpl", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalVectorArrayListImpl(int nameID, object values);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalMatrixArrayListImpl", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalMatrixArrayListImpl(int nameID, object values);

    /// <summary>
    ///   <para>Add a "set global shader float array property" command.</para>
    /// </summary>
    /// <param name="propertyName"></param>
    /// <param name="values"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalFloatArray", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetGlobalFloatArray(int nameID, [Unmarshalled] float[] values);

    /// <summary>
    ///   <para>Add a "set global shader vector array property" command.</para>
    /// </summary>
    /// <param name="propertyName"></param>
    /// <param name="values"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalVectorArray", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetGlobalVectorArray(int nameID, [Unmarshalled] Vector4[] values);

    /// <summary>
    ///   <para>Add a "set global shader matrix array property" command.</para>
    /// </summary>
    /// <param name="propertyName"></param>
    /// <param name="values"></param>
    /// <param name="nameID"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalMatrixArray", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetGlobalMatrixArray(int nameID, [Unmarshalled] Matrix4x4[] values);

    /// <summary>
    ///   <para>Set the current stereo projection matrices for late latching. Stereo matrices is passed in as an array of two matrices.</para>
    /// </summary>
    /// <param name="projectionMat">Stereo projection matrices.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetLateLatchProjectionMatrices", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetLateLatchProjectionMatrices([Unmarshalled] Matrix4x4[] projectionMat);

    /// <summary>
    ///   <para>Mark a global shader property id to be late latched.  Possible shader properties include view, inverseView, viewProjection, and inverseViewProjection matrices. The Universal Render Pipeline (URP) uses this function to support late latching of shader properties. If you call this function when using built-in Unity rendering or the High-Definition Rendering Pipeline (HDRP), the results are ignored.</para>
    /// </summary>
    /// <param name="matrixPropertyType">Camera matrix property type to be late latched.</param>
    /// <param name="shaderPropertyID">Shader property name id.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::MarkLateLatchMatrixShaderPropertyID", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void MarkLateLatchMatrixShaderPropertyID(
      CameraLateLatchMatrixType matrixPropertyType,
      int shaderPropertyID);

    /// <summary>
    ///   <para>Unmark a global shader property for late latching. After unmarking, the shader property will no longer be late latched.  This function is intended for the Universal Render Pipeline (URP) to specify late latched shader properties.</para>
    /// </summary>
    /// <param name="matrixPropertyType">Camera matrix property type to be unmarked for late latching.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::UnmarkLateLatchMatrix", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void UnmarkLateLatchMatrix(CameraLateLatchMatrixType matrixPropertyType);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalTexture_Impl", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalTexture_Impl(
      int nameID,
      ref RenderTargetIdentifier rt,
      RenderTextureSubElement element);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalBuffer", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalBufferInternal(int nameID, ComputeBuffer value);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalBuffer", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalGraphicsBufferInternal(int nameID, GraphicsBuffer value);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetShadowSamplingMode_Impl", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetShadowSamplingMode_Impl(
      ref RenderTargetIdentifier shadowmap,
      ShadowSamplingMode mode);

    [FreeFunction("RenderingCommandBuffer_Bindings::IssuePluginEventInternal", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void IssuePluginEventInternal(IntPtr callback, int eventID);

    /// <summary>
    ///   <para>Adds a command to begin profile sampling.</para>
    /// </summary>
    /// <param name="name">Name of the profile information used for sampling.</param>
    /// <param name="sampler">The CustomSampler that the CommandBuffer uses for sampling.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::BeginSample", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void BeginSample(string name);

    /// <summary>
    ///   <para>Adds a command to end profile sampling.</para>
    /// </summary>
    /// <param name="name">Name of the profile information used for sampling.</param>
    /// <param name="sampler">The CustomSampler that the CommandBuffer uses for sampling.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::EndSample", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void EndSample(string name);

    /// <summary>
    ///   <para>Adds a command to begin profile sampling.</para>
    /// </summary>
    /// <param name="name">Name of the profile information used for sampling.</param>
    /// <param name="sampler">The CustomSampler that the CommandBuffer uses for sampling.</param>
    public void BeginSample(CustomSampler sampler) => this.BeginSample_CustomSampler(sampler);

    /// <summary>
    ///   <para>Adds a command to end profile sampling.</para>
    /// </summary>
    /// <param name="name">Name of the profile information used for sampling.</param>
    /// <param name="sampler">The CustomSampler that the CommandBuffer uses for sampling.</param>
    public void EndSample(CustomSampler sampler) => this.EndSample_CustomSampler(sampler);

    [FreeFunction("RenderingCommandBuffer_Bindings::BeginSample_CustomSampler", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void BeginSample_CustomSampler([NotNull("ArgumentNullException")] CustomSampler sampler);

    [FreeFunction("RenderingCommandBuffer_Bindings::EndSample_CustomSampler", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void EndSample_CustomSampler([NotNull("ArgumentNullException")] CustomSampler sampler);

    [FreeFunction("RenderingCommandBuffer_Bindings::IssuePluginEventAndDataInternal", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void IssuePluginEventAndDataInternal(IntPtr callback, int eventID, IntPtr data);

    [FreeFunction("RenderingCommandBuffer_Bindings::IssuePluginCustomBlitInternal", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void IssuePluginCustomBlitInternal(
      IntPtr callback,
      uint command,
      ref RenderTargetIdentifier source,
      ref RenderTargetIdentifier dest,
      uint commandParam,
      uint commandFlags);

    [FreeFunction("RenderingCommandBuffer_Bindings::IssuePluginCustomTextureUpdateInternal", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void IssuePluginCustomTextureUpdateInternal(
      IntPtr callback,
      Texture targetTexture,
      uint userData,
      bool useNewUnityRenderingExtTextureUpdateParamsV2);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalConstantBuffer", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalConstantBufferInternal(
      ComputeBuffer buffer,
      int nameID,
      int offset,
      int size);

    [FreeFunction("RenderingCommandBuffer_Bindings::SetGlobalConstantBuffer", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalConstantGraphicsBufferInternal(
      GraphicsBuffer buffer,
      int nameID,
      int offset,
      int size);

    /// <summary>
    ///   <para>Increments the updateCount property of a Texture.</para>
    /// </summary>
    /// <param name="dest">Increments the updateCount for this Texture.</param>
    [FreeFunction("RenderingCommandBuffer_Bindings::IncrementUpdateCount", HasExplicitThis = true)]
    public void IncrementUpdateCount(RenderTargetIdentifier dest)
    {
      this.IncrementUpdateCount_Injected(ref dest);
    }

    /// <summary>
    ///   <para>Adds a command to multiply the instance count of every draw call by a specific multiplier.</para>
    /// </summary>
    /// <param name="multiplier"></param>
    [FreeFunction("RenderingCommandBuffer_Bindings::SetInstanceMultiplier", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public extern void SetInstanceMultiplier(uint multiplier);

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(RenderTargetIdentifier rt)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.SetRenderTargetSingle_Internal(rt, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier rt,
      RenderBufferLoadAction loadAction,
      RenderBufferStoreAction storeAction)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (loadAction == RenderBufferLoadAction.Clear)
        throw new ArgumentException("RenderBufferLoadAction.Clear is not supported");
      this.SetRenderTargetSingle_Internal(rt, loadAction, storeAction, loadAction, storeAction);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier rt,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (colorLoadAction == RenderBufferLoadAction.Clear || depthLoadAction == RenderBufferLoadAction.Clear)
        throw new ArgumentException("RenderBufferLoadAction.Clear is not supported");
      this.SetRenderTargetSingle_Internal(rt, colorLoadAction, colorStoreAction, depthLoadAction, depthStoreAction);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(RenderTargetIdentifier rt, int mipLevel)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (mipLevel < 0)
        throw new ArgumentException(string.Format("Invalid value for mipLevel ({0})", (object) mipLevel));
      this.SetRenderTargetSingle_Internal(new RenderTargetIdentifier(rt, mipLevel), RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(RenderTargetIdentifier rt, int mipLevel, CubemapFace cubemapFace)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (mipLevel < 0)
        throw new ArgumentException(string.Format("Invalid value for mipLevel ({0})", (object) mipLevel));
      this.SetRenderTargetSingle_Internal(new RenderTargetIdentifier(rt, mipLevel, cubemapFace), RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier rt,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (depthSlice < -1)
        throw new ArgumentException(string.Format("Invalid value for depthSlice ({0})", (object) depthSlice));
      if (mipLevel < 0)
        throw new ArgumentException(string.Format("Invalid value for mipLevel ({0})", (object) mipLevel));
      this.SetRenderTargetSingle_Internal(new RenderTargetIdentifier(rt, mipLevel, cubemapFace, depthSlice), RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(RenderTargetIdentifier color, RenderTargetIdentifier depth)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.SetRenderTargetColorDepth_Internal(color, depth, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderTargetFlags.None);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier color,
      RenderTargetIdentifier depth,
      int mipLevel)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (mipLevel < 0)
        throw new ArgumentException(string.Format("Invalid value for mipLevel ({0})", (object) mipLevel));
      this.SetRenderTargetColorDepth_Internal(new RenderTargetIdentifier(color, mipLevel), depth, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderTargetFlags.None);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier color,
      RenderTargetIdentifier depth,
      int mipLevel,
      CubemapFace cubemapFace)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (mipLevel < 0)
        throw new ArgumentException(string.Format("Invalid value for mipLevel ({0})", (object) mipLevel));
      this.SetRenderTargetColorDepth_Internal(new RenderTargetIdentifier(color, mipLevel, cubemapFace), depth, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderTargetFlags.None);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier color,
      RenderTargetIdentifier depth,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (depthSlice < -1)
        throw new ArgumentException(string.Format("Invalid value for depthSlice ({0})", (object) depthSlice));
      if (mipLevel < 0)
        throw new ArgumentException(string.Format("Invalid value for mipLevel ({0})", (object) mipLevel));
      this.SetRenderTargetColorDepth_Internal(new RenderTargetIdentifier(color, mipLevel, cubemapFace, depthSlice), depth, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderTargetFlags.None);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier color,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderTargetIdentifier depth,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (colorLoadAction == RenderBufferLoadAction.Clear || depthLoadAction == RenderBufferLoadAction.Clear)
        throw new ArgumentException("RenderBufferLoadAction.Clear is not supported");
      this.SetRenderTargetColorDepth_Internal(color, depth, colorLoadAction, colorStoreAction, depthLoadAction, depthStoreAction, RenderTargetFlags.None);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(RenderTargetIdentifier[] colors, RenderTargetIdentifier depth)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (colors.Length < 1)
        throw new ArgumentException(string.Format("colors.Length must be at least 1, but was {0}", (object) colors.Length));
      if (colors.Length > SystemInfo.supportedRenderTargetCount)
        throw new ArgumentException(string.Format("colors.Length is {0} and exceeds the maximum number of supported render targets ({1})", (object) colors.Length, (object) SystemInfo.supportedRenderTargetCount));
      this.SetRenderTargetMulti_Internal(colors, depth, (RenderBufferLoadAction[]) null, (RenderBufferStoreAction[]) null, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, RenderTargetFlags.None);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetIdentifier[] colors,
      RenderTargetIdentifier depth,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (colors.Length < 1)
        throw new ArgumentException(string.Format("colors.Length must be at least 1, but was {0}", (object) colors.Length));
      if (colors.Length > SystemInfo.supportedRenderTargetCount)
        throw new ArgumentException(string.Format("colors.Length is {0} and exceeds the maximum number of supported render targets ({1})", (object) colors.Length, (object) SystemInfo.supportedRenderTargetCount));
      this.SetRenderTargetMultiSubtarget(colors, depth, (RenderBufferLoadAction[]) null, (RenderBufferStoreAction[]) null, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store, mipLevel, cubemapFace, depthSlice);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(
      RenderTargetBinding binding,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (binding.colorRenderTargets.Length < 1)
        throw new ArgumentException(string.Format("The number of color render targets must be at least 1, but was {0}", (object) binding.colorRenderTargets.Length));
      if (binding.colorRenderTargets.Length > SystemInfo.supportedRenderTargetCount)
        throw new ArgumentException(string.Format("The number of color render targets ({0}) and exceeds the maximum supported number of render targets ({1})", (object) binding.colorRenderTargets.Length, (object) SystemInfo.supportedRenderTargetCount));
      if (binding.colorLoadActions.Length != binding.colorRenderTargets.Length)
        throw new ArgumentException(string.Format("The number of color load actions provided ({0}) does not match the number of color render targets ({1})", (object) binding.colorLoadActions.Length, (object) binding.colorRenderTargets.Length));
      if (binding.colorStoreActions.Length != binding.colorRenderTargets.Length)
        throw new ArgumentException(string.Format("The number of color store actions provided ({0}) does not match the number of color render targets ({1})", (object) binding.colorLoadActions.Length, (object) binding.colorRenderTargets.Length));
      if (binding.depthLoadAction == RenderBufferLoadAction.Clear || Array.IndexOf<RenderBufferLoadAction>(binding.colorLoadActions, RenderBufferLoadAction.Clear) > -1)
        throw new ArgumentException("RenderBufferLoadAction.Clear is not supported");
      if (binding.colorRenderTargets.Length == 1)
        this.SetRenderTargetColorDepthSubtarget(binding.colorRenderTargets[0], binding.depthRenderTarget, binding.colorLoadActions[0], binding.colorStoreActions[0], binding.depthLoadAction, binding.depthStoreAction, mipLevel, cubemapFace, depthSlice);
      else
        this.SetRenderTargetMultiSubtarget(binding.colorRenderTargets, binding.depthRenderTarget, binding.colorLoadActions, binding.colorStoreActions, binding.depthLoadAction, binding.depthStoreAction, mipLevel, cubemapFace, depthSlice);
    }

    /// <summary>
    ///   <para>Add a "set active render target" command.</para>
    /// </summary>
    /// <param name="rt">Render target to set for both color &amp; depth buffers.</param>
    /// <param name="color">Render target to set as a color buffer.</param>
    /// <param name="colors">Render targets to set as color buffers (MRT).</param>
    /// <param name="depth">Render target to set as a depth buffer.</param>
    /// <param name="mipLevel">The mip level of the render target to render into.</param>
    /// <param name="cubemapFace">The cubemap face of a cubemap render target to render into.</param>
    /// <param name="depthSlice">Slice of a 3D or array render target to set.</param>
    /// <param name="loadAction">Load action that is used for color and depth/stencil buffers.</param>
    /// <param name="storeAction">Store action that is used for color and depth/stencil buffers.</param>
    /// <param name="colorLoadAction">Load action that is used for the color buffer.</param>
    /// <param name="colorStoreAction">Store action that is used for the color buffer.</param>
    /// <param name="depthLoadAction">Load action that is used for the depth/stencil buffer.</param>
    /// <param name="depthStoreAction">Store action that is used for the depth/stencil buffer.</param>
    /// <param name="binding"></param>
    public void SetRenderTarget(RenderTargetBinding binding)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (binding.colorRenderTargets.Length < 1)
        throw new ArgumentException(string.Format("The number of color render targets must be at least 1, but was {0}", (object) binding.colorRenderTargets.Length));
      if (binding.colorRenderTargets.Length > SystemInfo.supportedRenderTargetCount)
        throw new ArgumentException(string.Format("The number of color render targets ({0}) and exceeds the maximum supported number of render targets ({1})", (object) binding.colorRenderTargets.Length, (object) SystemInfo.supportedRenderTargetCount));
      if (binding.colorLoadActions.Length != binding.colorRenderTargets.Length)
        throw new ArgumentException(string.Format("The number of color load actions provided ({0}) does not match the number of color render targets ({1})", (object) binding.colorLoadActions.Length, (object) binding.colorRenderTargets.Length));
      if (binding.colorStoreActions.Length != binding.colorRenderTargets.Length)
        throw new ArgumentException(string.Format("The number of color store actions provided ({0}) does not match the number of color render targets ({1})", (object) binding.colorLoadActions.Length, (object) binding.colorRenderTargets.Length));
      if (binding.depthLoadAction == RenderBufferLoadAction.Clear || Array.IndexOf<RenderBufferLoadAction>(binding.colorLoadActions, RenderBufferLoadAction.Clear) > -1)
        throw new ArgumentException("RenderBufferLoadAction.Clear is not supported");
      if (binding.colorRenderTargets.Length == 1)
        this.SetRenderTargetColorDepth_Internal(binding.colorRenderTargets[0], binding.depthRenderTarget, binding.colorLoadActions[0], binding.colorStoreActions[0], binding.depthLoadAction, binding.depthStoreAction, binding.flags);
      else
        this.SetRenderTargetMulti_Internal(binding.colorRenderTargets, binding.depthRenderTarget, binding.colorLoadActions, binding.colorStoreActions, binding.depthLoadAction, binding.depthStoreAction, binding.flags);
    }

    private void SetRenderTargetSingle_Internal(
      RenderTargetIdentifier rt,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction)
    {
      this.SetRenderTargetSingle_Internal_Injected(ref rt, colorLoadAction, colorStoreAction, depthLoadAction, depthStoreAction);
    }

    private void SetRenderTargetColorDepth_Internal(
      RenderTargetIdentifier color,
      RenderTargetIdentifier depth,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      RenderTargetFlags flags)
    {
      this.SetRenderTargetColorDepth_Internal_Injected(ref color, ref depth, colorLoadAction, colorStoreAction, depthLoadAction, depthStoreAction, flags);
    }

    private void SetRenderTargetMulti_Internal(
      RenderTargetIdentifier[] colors,
      RenderTargetIdentifier depth,
      RenderBufferLoadAction[] colorLoadActions,
      RenderBufferStoreAction[] colorStoreActions,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      RenderTargetFlags flags)
    {
      this.SetRenderTargetMulti_Internal_Injected(colors, ref depth, colorLoadActions, colorStoreActions, depthLoadAction, depthStoreAction, flags);
    }

    private void SetRenderTargetColorDepthSubtarget(
      RenderTargetIdentifier color,
      RenderTargetIdentifier depth,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice)
    {
      this.SetRenderTargetColorDepthSubtarget_Injected(ref color, ref depth, colorLoadAction, colorStoreAction, depthLoadAction, depthStoreAction, mipLevel, cubemapFace, depthSlice);
    }

    private void SetRenderTargetMultiSubtarget(
      RenderTargetIdentifier[] colors,
      RenderTargetIdentifier depth,
      RenderBufferLoadAction[] colorLoadActions,
      RenderBufferStoreAction[] colorStoreActions,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice)
    {
      this.SetRenderTargetMultiSubtarget_Injected(colors, ref depth, colorLoadActions, colorStoreActions, depthLoadAction, depthStoreAction, mipLevel, cubemapFace, depthSlice);
    }

    [NativeMethod("ProcessVTFeedback")]
    private void Internal_ProcessVTFeedback(
      RenderTargetIdentifier rt,
      IntPtr resolver,
      int slice,
      int x,
      int width,
      int y,
      int height,
      int mip)
    {
      this.Internal_ProcessVTFeedback_Injected(ref rt, resolver, slice, x, width, y, height, mip);
    }

    /// <summary>
    ///   <para>Adds a command to set the buffer with values from an array.</para>
    /// </summary>
    /// <param name="buffer">The destination buffer.</param>
    /// <param name="data">Array of values to fill the buffer.</param>
    [SecuritySafeCritical]
    public void SetBufferData(ComputeBuffer buffer, Array data)
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsArrayBlittable(data))
        throw new ArgumentException(string.Format("Array passed to RenderingCommandBuffer.SetBufferData(array) must be blittable.\n{0}", (object) UnsafeUtility.GetReasonForArrayNonBlittable(data)));
      this.InternalSetComputeBufferData(buffer, data, 0, 0, data.Length, UnsafeUtility.SizeOf(data.GetType().GetElementType()));
    }

    [SecuritySafeCritical]
    public void SetBufferData<T>(ComputeBuffer buffer, List<T> data) where T : struct
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsGenericListBlittable<T>())
        throw new ArgumentException(string.Format("List<{0}> passed to RenderingCommandBuffer.SetBufferData(List<>) must be blittable.\n{1}", (object) typeof (T), (object) UnsafeUtility.GetReasonForGenericListNonBlittable<T>()));
      this.InternalSetComputeBufferData(buffer, NoAllocHelpers.ExtractArrayFromList((object) data), 0, 0, NoAllocHelpers.SafeLength<T>(data), Marshal.SizeOf(typeof (T)));
    }

    [SecuritySafeCritical]
    public unsafe void SetBufferData<T>(ComputeBuffer buffer, NativeArray<T> data) where T : struct
    {
      this.InternalSetComputeBufferNativeData(buffer, (IntPtr) data.GetUnsafeReadOnlyPtr<T>(), 0, 0, data.Length, UnsafeUtility.SizeOf<T>());
    }

    /// <summary>
    ///   <para>Adds a command to process a partial copy of data values from an array into the buffer.</para>
    /// </summary>
    /// <param name="buffer">The destination buffer.</param>
    /// <param name="data">Array of values to fill the buffer.</param>
    /// <param name="managedBufferStartIndex">The first element index in data to copy to the compute buffer.</param>
    /// <param name="graphicsBufferStartIndex">The first element index in compute buffer to receive the data.</param>
    /// <param name="count">The number of elements to copy.</param>
    /// <param name="nativeBufferStartIndex">The first element index in data to copy to the compute buffer.</param>
    [SecuritySafeCritical]
    public void SetBufferData(
      ComputeBuffer buffer,
      Array data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsArrayBlittable(data))
        throw new ArgumentException(string.Format("Array passed to RenderingCommandBuffer.SetBufferData(array) must be blittable.\n{0}", (object) UnsafeUtility.GetReasonForArrayNonBlittable(data)));
      if (managedBufferStartIndex < 0 || graphicsBufferStartIndex < 0 || count < 0 || managedBufferStartIndex + count > data.Length)
        throw new ArgumentOutOfRangeException(string.Format("Bad indices/count arguments (managedBufferStartIndex:{0} graphicsBufferStartIndex:{1} count:{2})", (object) managedBufferStartIndex, (object) graphicsBufferStartIndex, (object) count));
      this.InternalSetComputeBufferData(buffer, data, managedBufferStartIndex, graphicsBufferStartIndex, count, Marshal.SizeOf(data.GetType().GetElementType()));
    }

    [SecuritySafeCritical]
    public void SetBufferData<T>(
      ComputeBuffer buffer,
      List<T> data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
      where T : struct
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsGenericListBlittable<T>())
        throw new ArgumentException(string.Format("List<{0}> passed to RenderingCommandBuffer.SetBufferData(List<>) must be blittable.\n{1}", (object) typeof (T), (object) UnsafeUtility.GetReasonForGenericListNonBlittable<T>()));
      if (managedBufferStartIndex < 0 || graphicsBufferStartIndex < 0 || count < 0 || managedBufferStartIndex + count > data.Count)
        throw new ArgumentOutOfRangeException(string.Format("Bad indices/count arguments (managedBufferStartIndex:{0} graphicsBufferStartIndex:{1} count:{2})", (object) managedBufferStartIndex, (object) graphicsBufferStartIndex, (object) count));
      this.InternalSetComputeBufferData(buffer, NoAllocHelpers.ExtractArrayFromList((object) data), managedBufferStartIndex, graphicsBufferStartIndex, count, Marshal.SizeOf(typeof (T)));
    }

    [SecuritySafeCritical]
    public unsafe void SetBufferData<T>(
      ComputeBuffer buffer,
      NativeArray<T> data,
      int nativeBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
      where T : struct
    {
      if (nativeBufferStartIndex < 0 || graphicsBufferStartIndex < 0 || count < 0 || nativeBufferStartIndex + count > data.Length)
        throw new ArgumentOutOfRangeException(string.Format("Bad indices/count arguments (nativeBufferStartIndex:{0} graphicsBufferStartIndex:{1} count:{2})", (object) nativeBufferStartIndex, (object) graphicsBufferStartIndex, (object) count));
      this.InternalSetComputeBufferNativeData(buffer, (IntPtr) data.GetUnsafeReadOnlyPtr<T>(), nativeBufferStartIndex, graphicsBufferStartIndex, count, UnsafeUtility.SizeOf<T>());
    }

    /// <summary>
    ///   <para>Adds a command to set the counter value of append/consume buffer.</para>
    /// </summary>
    /// <param name="buffer">The destination buffer.</param>
    /// <param name="counterValue">Value of the append/consume counter.</param>
    public void SetBufferCounterValue(ComputeBuffer buffer, uint counterValue)
    {
      this.InternalSetComputeBufferCounterValue(buffer, counterValue);
    }

    [FreeFunction(Name = "RenderingCommandBuffer_Bindings::InternalSetGraphicsBufferNativeData", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void InternalSetComputeBufferNativeData(
      [NotNull("ArgumentNullException")] ComputeBuffer buffer,
      IntPtr data,
      int nativeBufferStartIndex,
      int graphicsBufferStartIndex,
      int count,
      int elemSize);

    [FreeFunction(Name = "RenderingCommandBuffer_Bindings::InternalSetGraphicsBufferData", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void InternalSetComputeBufferData(
      [NotNull("ArgumentNullException")] ComputeBuffer buffer,
      Array data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count,
      int elemSize);

    [FreeFunction(Name = "RenderingCommandBuffer_Bindings::InternalSetGraphicsBufferCounterValue", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void InternalSetComputeBufferCounterValue(
      [NotNull("ArgumentNullException")] ComputeBuffer buffer,
      uint counterValue);

    /// <summary>
    ///   <para>Adds a command to set the buffer with values from an array.</para>
    /// </summary>
    /// <param name="buffer">The destination buffer.</param>
    /// <param name="data">Array of values to fill the buffer.</param>
    [SecuritySafeCritical]
    public void SetBufferData(GraphicsBuffer buffer, Array data)
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsArrayBlittable(data))
        throw new ArgumentException(string.Format("Array passed to RenderingCommandBuffer.SetBufferData(array) must be blittable.\n{0}", (object) UnsafeUtility.GetReasonForArrayNonBlittable(data)));
      this.InternalSetGraphicsBufferData(buffer, data, 0, 0, data.Length, UnsafeUtility.SizeOf(data.GetType().GetElementType()));
    }

    [SecuritySafeCritical]
    public void SetBufferData<T>(GraphicsBuffer buffer, List<T> data) where T : struct
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsGenericListBlittable<T>())
        throw new ArgumentException(string.Format("List<{0}> passed to RenderingCommandBuffer.SetBufferData(List<>) must be blittable.\n{1}", (object) typeof (T), (object) UnsafeUtility.GetReasonForGenericListNonBlittable<T>()));
      this.InternalSetGraphicsBufferData(buffer, NoAllocHelpers.ExtractArrayFromList((object) data), 0, 0, NoAllocHelpers.SafeLength<T>(data), Marshal.SizeOf(typeof (T)));
    }

    [SecuritySafeCritical]
    public unsafe void SetBufferData<T>(GraphicsBuffer buffer, NativeArray<T> data) where T : struct
    {
      this.InternalSetGraphicsBufferNativeData(buffer, (IntPtr) data.GetUnsafeReadOnlyPtr<T>(), 0, 0, data.Length, UnsafeUtility.SizeOf<T>());
    }

    /// <summary>
    ///   <para>Adds a command to process a partial copy of data values from an array into the buffer.</para>
    /// </summary>
    /// <param name="buffer">The destination buffer.</param>
    /// <param name="data">Array of values to fill the buffer.</param>
    /// <param name="managedBufferStartIndex">The first element index in data to copy to the compute buffer.</param>
    /// <param name="graphicsBufferStartIndex">The first element index in compute buffer to receive the data.</param>
    /// <param name="count">The number of elements to copy.</param>
    /// <param name="nativeBufferStartIndex">The first element index in data to copy to the compute buffer.</param>
    [SecuritySafeCritical]
    public void SetBufferData(
      GraphicsBuffer buffer,
      Array data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsArrayBlittable(data))
        throw new ArgumentException(string.Format("Array passed to RenderingCommandBuffer.SetBufferData(array) must be blittable.\n{0}", (object) UnsafeUtility.GetReasonForArrayNonBlittable(data)));
      if (managedBufferStartIndex < 0 || graphicsBufferStartIndex < 0 || count < 0 || managedBufferStartIndex + count > data.Length)
        throw new ArgumentOutOfRangeException(string.Format("Bad indices/count arguments (managedBufferStartIndex:{0} graphicsBufferStartIndex:{1} count:{2})", (object) managedBufferStartIndex, (object) graphicsBufferStartIndex, (object) count));
      this.InternalSetGraphicsBufferData(buffer, data, managedBufferStartIndex, graphicsBufferStartIndex, count, Marshal.SizeOf(data.GetType().GetElementType()));
    }

    [SecuritySafeCritical]
    public void SetBufferData<T>(
      GraphicsBuffer buffer,
      List<T> data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
      where T : struct
    {
      if (data == null)
        throw new ArgumentNullException(nameof (data));
      if (!UnsafeUtility.IsGenericListBlittable<T>())
        throw new ArgumentException(string.Format("List<{0}> passed to RenderingCommandBuffer.SetBufferData(List<>) must be blittable.\n{1}", (object) typeof (T), (object) UnsafeUtility.GetReasonForGenericListNonBlittable<T>()));
      if (managedBufferStartIndex < 0 || graphicsBufferStartIndex < 0 || count < 0 || managedBufferStartIndex + count > data.Count)
        throw new ArgumentOutOfRangeException(string.Format("Bad indices/count arguments (managedBufferStartIndex:{0} graphicsBufferStartIndex:{1} count:{2})", (object) managedBufferStartIndex, (object) graphicsBufferStartIndex, (object) count));
      this.InternalSetGraphicsBufferData(buffer, NoAllocHelpers.ExtractArrayFromList((object) data), managedBufferStartIndex, graphicsBufferStartIndex, count, Marshal.SizeOf(typeof (T)));
    }

    [SecuritySafeCritical]
    public unsafe void SetBufferData<T>(
      GraphicsBuffer buffer,
      NativeArray<T> data,
      int nativeBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
      where T : struct
    {
      if (nativeBufferStartIndex < 0 || graphicsBufferStartIndex < 0 || count < 0 || nativeBufferStartIndex + count > data.Length)
        throw new ArgumentOutOfRangeException(string.Format("Bad indices/count arguments (nativeBufferStartIndex:{0} graphicsBufferStartIndex:{1} count:{2})", (object) nativeBufferStartIndex, (object) graphicsBufferStartIndex, (object) count));
      this.InternalSetGraphicsBufferNativeData(buffer, (IntPtr) data.GetUnsafeReadOnlyPtr<T>(), nativeBufferStartIndex, graphicsBufferStartIndex, count, UnsafeUtility.SizeOf<T>());
    }

    /// <summary>
    ///   <para>Adds a command to set the counter value of append/consume buffer.</para>
    /// </summary>
    /// <param name="buffer">The destination buffer.</param>
    /// <param name="counterValue">Value of the append/consume counter.</param>
    public void SetBufferCounterValue(GraphicsBuffer buffer, uint counterValue)
    {
      this.InternalSetGraphicsBufferCounterValue(buffer, counterValue);
    }

    [FreeFunction(Name = "RenderingCommandBuffer_Bindings::InternalSetGraphicsBufferNativeData", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void InternalSetGraphicsBufferNativeData(
      [NotNull("ArgumentNullException")] GraphicsBuffer buffer,
      IntPtr data,
      int nativeBufferStartIndex,
      int graphicsBufferStartIndex,
      int count,
      int elemSize);

    [SecurityCritical]
    [FreeFunction(Name = "RenderingCommandBuffer_Bindings::InternalSetGraphicsBufferData", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void InternalSetGraphicsBufferData(
      [NotNull("ArgumentNullException")] GraphicsBuffer buffer,
      Array data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count,
      int elemSize);

    [FreeFunction(Name = "RenderingCommandBuffer_Bindings::InternalSetGraphicsBufferCounterValue", HasExplicitThis = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void InternalSetGraphicsBufferCounterValue(
      [NotNull("ArgumentNullException")] GraphicsBuffer buffer,
      uint counterValue);

    [FreeFunction(Name = "RenderingCommandBuffer_Bindings::CopyBuffer", HasExplicitThis = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void CopyBufferImpl([NotNull("ArgumentNullException")] GraphicsBuffer source, [NotNull("ArgumentNullException")] GraphicsBuffer dest);

    ~CommandBuffer() => this.Dispose(false);

    public void Dispose()
    {
      this.Dispose(true);
      GC.SuppressFinalize((object) this);
    }

    private void Dispose(bool disposing)
    {
      this.ReleaseBuffer();
      this.m_Ptr = IntPtr.Zero;
    }

    /// <summary>
    ///   <para>Create a new empty command buffer.</para>
    /// </summary>
    public CommandBuffer() => this.m_Ptr = CommandBuffer.InitBuffer();

    public void Release() => this.Dispose();

    /// <summary>
    ///   <para>Shortcut for calling CommandBuffer.CreateGraphicsFence with Rendering.GraphicsFenceType.AsyncQueueSynchronisation as the first parameter.</para>
    /// </summary>
    /// <param name="stage">Which SynchronisationStage to insert the fence after.</param>
    /// <returns>
    ///   <para>Returns a new GraphicsFence.</para>
    /// </returns>
    public GraphicsFence CreateAsyncGraphicsFence()
    {
      return this.CreateGraphicsFence(GraphicsFenceType.AsyncQueueSynchronisation, SynchronisationStageFlags.PixelProcessing);
    }

    /// <summary>
    ///   <para>Shortcut for calling CommandBuffer.CreateGraphicsFence with Rendering.GraphicsFenceType.AsyncQueueSynchronisation as the first parameter.</para>
    /// </summary>
    /// <param name="stage">Which SynchronisationStage to insert the fence after.</param>
    /// <returns>
    ///   <para>Returns a new GraphicsFence.</para>
    /// </returns>
    public GraphicsFence CreateAsyncGraphicsFence(SynchronisationStage stage)
    {
      return this.CreateGraphicsFence(GraphicsFenceType.AsyncQueueSynchronisation, GraphicsFence.TranslateSynchronizationStageToFlags(stage));
    }

    /// <summary>
    ///   <para>Creates a GraphicsFence.</para>
    /// </summary>
    /// <param name="fenceType">The Rendering.GraphicsFenceType to create. Currently the only supported value is Rendering.GraphicsFenceType.AsyncQueueSynchronisation.</param>
    /// <param name="stage">Which SynchronisationStage to insert the fence after.</param>
    /// <returns>
    ///   <para>Returns a new GraphicsFence.</para>
    /// </returns>
    public GraphicsFence CreateGraphicsFence(
      GraphicsFenceType fenceType,
      SynchronisationStageFlags stage)
    {
      GraphicsFence graphicsFence = new GraphicsFence();
      graphicsFence.m_FenceType = fenceType;
      graphicsFence.m_Ptr = this.CreateGPUFence_Internal(fenceType, stage);
      graphicsFence.InitPostAllocation();
      graphicsFence.Validate();
      return graphicsFence;
    }

    /// <summary>
    ///   <para>Instructs the GPU to pause processing of the queue until it passes through the GraphicsFence fence.</para>
    /// </summary>
    /// <param name="fence">The GraphicsFence the GPU waits for. The fenceType of the graphics fence must be Rendering.GraphicsFenceType.AsyncQueueSynchronisation.</param>
    /// <param name="stage">Which SynchronisationStage to wait for.</param>
    public void WaitOnAsyncGraphicsFence(GraphicsFence fence)
    {
      this.WaitOnAsyncGraphicsFence(fence, SynchronisationStage.VertexProcessing);
    }

    /// <summary>
    ///   <para>Instructs the GPU to pause processing of the queue until it passes through the GraphicsFence fence.</para>
    /// </summary>
    /// <param name="fence">The GraphicsFence the GPU waits for. The fenceType of the graphics fence must be Rendering.GraphicsFenceType.AsyncQueueSynchronisation.</param>
    /// <param name="stage">Which SynchronisationStage to wait for.</param>
    public void WaitOnAsyncGraphicsFence(GraphicsFence fence, SynchronisationStage stage)
    {
      this.WaitOnAsyncGraphicsFence(fence, GraphicsFence.TranslateSynchronizationStageToFlags(stage));
    }

    public void WaitOnAsyncGraphicsFence(GraphicsFence fence, SynchronisationStageFlags stage)
    {
      if (fence.m_FenceType != 0)
        throw new ArgumentException("Attempting to call WaitOnAsyncGPUFence on a fence that is not of GraphicsFenceType.AsyncQueueSynchronization");
      fence.Validate();
      if (!fence.IsFencePending())
        return;
      this.WaitOnGPUFence_Internal(fence.m_Ptr, stage);
    }

    /// <summary>
    ///   <para>Adds a command to set a float parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetComputeFloatParam(ComputeShader computeShader, string name, float val)
    {
      this.SetComputeFloatParam(computeShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set an integer parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetComputeIntParam(ComputeShader computeShader, string name, int val)
    {
      this.SetComputeIntParam(computeShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set a vector parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetComputeVectorParam(ComputeShader computeShader, string name, Vector4 val)
    {
      this.SetComputeVectorParam(computeShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set a vector array parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Property name.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    public void SetComputeVectorArrayParam(
      ComputeShader computeShader,
      string name,
      Vector4[] values)
    {
      this.SetComputeVectorArrayParam(computeShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set a matrix parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetComputeMatrixParam(ComputeShader computeShader, string name, Matrix4x4 val)
    {
      this.SetComputeMatrixParam(computeShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set a matrix array parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    public void SetComputeMatrixArrayParam(
      ComputeShader computeShader,
      string name,
      Matrix4x4[] values)
    {
      this.SetComputeMatrixArrayParam(computeShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive float parameters on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetComputeFloatParams(
      ComputeShader computeShader,
      string name,
      params float[] values)
    {
      this.Internal_SetComputeFloats(computeShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive float parameters on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetComputeFloatParams(
      ComputeShader computeShader,
      int nameID,
      params float[] values)
    {
      this.Internal_SetComputeFloats(computeShader, nameID, values);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive integer parameters on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetComputeIntParams(ComputeShader computeShader, string name, params int[] values)
    {
      this.Internal_SetComputeInts(computeShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive integer parameters on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetComputeIntParams(ComputeShader computeShader, int nameID, params int[] values)
    {
      this.Internal_SetComputeInts(computeShader, nameID, values);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the texture is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    /// <param name="mipLevel">Optional mipmap level of the read-write texture.</param>
    /// <param name="element">Optional parameter that specifies the type of data to set from the RenderTexture.</param>
    public void SetComputeTextureParam(
      ComputeShader computeShader,
      int kernelIndex,
      string name,
      RenderTargetIdentifier rt)
    {
      this.Internal_SetComputeTextureParam(computeShader, kernelIndex, Shader.PropertyToID(name), ref rt, 0, RenderTextureSubElement.Default);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the texture is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    /// <param name="mipLevel">Optional mipmap level of the read-write texture.</param>
    /// <param name="element">Optional parameter that specifies the type of data to set from the RenderTexture.</param>
    public void SetComputeTextureParam(
      ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      RenderTargetIdentifier rt)
    {
      this.Internal_SetComputeTextureParam(computeShader, kernelIndex, nameID, ref rt, 0, RenderTextureSubElement.Default);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the texture is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    /// <param name="mipLevel">Optional mipmap level of the read-write texture.</param>
    /// <param name="element">Optional parameter that specifies the type of data to set from the RenderTexture.</param>
    public void SetComputeTextureParam(
      ComputeShader computeShader,
      int kernelIndex,
      string name,
      RenderTargetIdentifier rt,
      int mipLevel)
    {
      this.Internal_SetComputeTextureParam(computeShader, kernelIndex, Shader.PropertyToID(name), ref rt, mipLevel, RenderTextureSubElement.Default);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the texture is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    /// <param name="mipLevel">Optional mipmap level of the read-write texture.</param>
    /// <param name="element">Optional parameter that specifies the type of data to set from the RenderTexture.</param>
    public void SetComputeTextureParam(
      ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      RenderTargetIdentifier rt,
      int mipLevel)
    {
      this.Internal_SetComputeTextureParam(computeShader, kernelIndex, nameID, ref rt, mipLevel, RenderTextureSubElement.Default);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the texture is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    /// <param name="mipLevel">Optional mipmap level of the read-write texture.</param>
    /// <param name="element">Optional parameter that specifies the type of data to set from the RenderTexture.</param>
    public void SetComputeTextureParam(
      ComputeShader computeShader,
      int kernelIndex,
      string name,
      RenderTargetIdentifier rt,
      int mipLevel,
      RenderTextureSubElement element)
    {
      this.Internal_SetComputeTextureParam(computeShader, kernelIndex, Shader.PropertyToID(name), ref rt, mipLevel, element);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the texture is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    /// <param name="mipLevel">Optional mipmap level of the read-write texture.</param>
    /// <param name="element">Optional parameter that specifies the type of data to set from the RenderTexture.</param>
    public void SetComputeTextureParam(
      ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      RenderTargetIdentifier rt,
      int mipLevel,
      RenderTextureSubElement element)
    {
      this.Internal_SetComputeTextureParam(computeShader, kernelIndex, nameID, ref rt, mipLevel, element);
    }

    /// <summary>
    ///   <para>Adds a command to set an input or output buffer parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the buffer is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the buffer variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="buffer">Buffer to set.</param>
    public void SetComputeBufferParam(
      ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      ComputeBuffer buffer)
    {
      this.Internal_SetComputeBufferParam(computeShader, kernelIndex, nameID, buffer);
    }

    /// <summary>
    ///   <para>Adds a command to set an input or output buffer parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the buffer is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the buffer variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="buffer">Buffer to set.</param>
    public void SetComputeBufferParam(
      ComputeShader computeShader,
      int kernelIndex,
      string name,
      ComputeBuffer buffer)
    {
      this.Internal_SetComputeBufferParam(computeShader, kernelIndex, Shader.PropertyToID(name), buffer);
    }

    /// <summary>
    ///   <para>Adds a command to set an input or output buffer parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the buffer is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the buffer variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="buffer">Buffer to set.</param>
    public void SetComputeBufferParam(
      ComputeShader computeShader,
      int kernelIndex,
      int nameID,
      GraphicsBuffer buffer)
    {
      this.Internal_SetComputeGraphicsBufferParam(computeShader, kernelIndex, nameID, buffer);
    }

    /// <summary>
    ///   <para>Adds a command to set an input or output buffer parameter on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to set parameter for.</param>
    /// <param name="kernelIndex">Which kernel the buffer is being set for. See ComputeShader.FindKernel.</param>
    /// <param name="name">Name of the buffer variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="buffer">Buffer to set.</param>
    public void SetComputeBufferParam(
      ComputeShader computeShader,
      int kernelIndex,
      string name,
      GraphicsBuffer buffer)
    {
      this.Internal_SetComputeGraphicsBufferParam(computeShader, kernelIndex, Shader.PropertyToID(name), buffer);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">The ComputeShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shaders code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetComputeConstantBufferParam(
      ComputeShader computeShader,
      int nameID,
      ComputeBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetComputeConstantComputeBufferParam(computeShader, nameID, buffer, offset, size);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">The ComputeShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shaders code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetComputeConstantBufferParam(
      ComputeShader computeShader,
      string name,
      ComputeBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetComputeConstantComputeBufferParam(computeShader, Shader.PropertyToID(name), buffer, offset, size);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">The ComputeShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shaders code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetComputeConstantBufferParam(
      ComputeShader computeShader,
      int nameID,
      GraphicsBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetComputeConstantGraphicsBufferParam(computeShader, nameID, buffer, offset, size);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">The ComputeShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shaders code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetComputeConstantBufferParam(
      ComputeShader computeShader,
      string name,
      GraphicsBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetComputeConstantGraphicsBufferParam(computeShader, Shader.PropertyToID(name), buffer, offset, size);
    }

    /// <summary>
    ///   <para>Add a command to execute a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to execute.</param>
    /// <param name="kernelIndex">Kernel index to execute, see ComputeShader.FindKernel.</param>
    /// <param name="threadGroupsX">Number of work groups in the X dimension.</param>
    /// <param name="threadGroupsY">Number of work groups in the Y dimension.</param>
    /// <param name="threadGroupsZ">Number of work groups in the Z dimension.</param>
    /// <param name="indirectBuffer">ComputeBuffer with dispatch arguments.</param>
    /// <param name="argsOffset">Byte offset indicating the location of the dispatch arguments in the buffer.</param>
    public void DispatchCompute(
      ComputeShader computeShader,
      int kernelIndex,
      int threadGroupsX,
      int threadGroupsY,
      int threadGroupsZ)
    {
      this.Internal_DispatchCompute(computeShader, kernelIndex, threadGroupsX, threadGroupsY, threadGroupsZ);
    }

    /// <summary>
    ///   <para>Add a command to execute a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to execute.</param>
    /// <param name="kernelIndex">Kernel index to execute, see ComputeShader.FindKernel.</param>
    /// <param name="threadGroupsX">Number of work groups in the X dimension.</param>
    /// <param name="threadGroupsY">Number of work groups in the Y dimension.</param>
    /// <param name="threadGroupsZ">Number of work groups in the Z dimension.</param>
    /// <param name="indirectBuffer">ComputeBuffer with dispatch arguments.</param>
    /// <param name="argsOffset">Byte offset indicating the location of the dispatch arguments in the buffer.</param>
    public void DispatchCompute(
      ComputeShader computeShader,
      int kernelIndex,
      ComputeBuffer indirectBuffer,
      uint argsOffset)
    {
      this.Internal_DispatchComputeIndirect(computeShader, kernelIndex, indirectBuffer, argsOffset);
    }

    /// <summary>
    ///   <para>Add a command to execute a ComputeShader.</para>
    /// </summary>
    /// <param name="computeShader">ComputeShader to execute.</param>
    /// <param name="kernelIndex">Kernel index to execute, see ComputeShader.FindKernel.</param>
    /// <param name="threadGroupsX">Number of work groups in the X dimension.</param>
    /// <param name="threadGroupsY">Number of work groups in the Y dimension.</param>
    /// <param name="threadGroupsZ">Number of work groups in the Z dimension.</param>
    /// <param name="indirectBuffer">ComputeBuffer with dispatch arguments.</param>
    /// <param name="argsOffset">Byte offset indicating the location of the dispatch arguments in the buffer.</param>
    public void DispatchCompute(
      ComputeShader computeShader,
      int kernelIndex,
      GraphicsBuffer indirectBuffer,
      uint argsOffset)
    {
      this.Internal_DispatchComputeIndirectGraphicsBuffer(computeShader, kernelIndex, indirectBuffer, argsOffset);
    }

    /// <summary>
    ///   <para>Adds a command to build the RayTracingAccelerationStructure to be used in a ray tracing dispatch.</para>
    /// </summary>
    /// <param name="accelerationStructure">The RayTracingAccelerationStructure to be generated.</param>
    public void BuildRayTracingAccelerationStructure(
      RayTracingAccelerationStructure accelerationStructure)
    {
      Vector3 relativeOrigin = new Vector3(0.0f, 0.0f, 0.0f);
      this.Internal_BuildRayTracingAccelerationStructure(accelerationStructure, relativeOrigin);
    }

    public void BuildRayTracingAccelerationStructure(
      RayTracingAccelerationStructure accelerationStructure,
      Vector3 relativeOrigin)
    {
      this.Internal_BuildRayTracingAccelerationStructure(accelerationStructure, relativeOrigin);
    }

    /// <summary>
    ///   <para>Adds a command to set the RayTracingAccelerationStructure to be used with the RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the RayTracingAccelerationStructure in shader coder.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rayTracingAccelerationStructure">The RayTracingAccelerationStructure to be used.</param>
    public void SetRayTracingAccelerationStructure(
      RayTracingShader rayTracingShader,
      string name,
      RayTracingAccelerationStructure rayTracingAccelerationStructure)
    {
      this.Internal_SetRayTracingAccelerationStructure(rayTracingShader, Shader.PropertyToID(name), rayTracingAccelerationStructure);
    }

    /// <summary>
    ///   <para>Adds a command to set the RayTracingAccelerationStructure to be used with the RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the RayTracingAccelerationStructure in shader coder.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rayTracingAccelerationStructure">The RayTracingAccelerationStructure to be used.</param>
    public void SetRayTracingAccelerationStructure(
      RayTracingShader rayTracingShader,
      int nameID,
      RayTracingAccelerationStructure rayTracingAccelerationStructure)
    {
      this.Internal_SetRayTracingAccelerationStructure(rayTracingShader, nameID, rayTracingAccelerationStructure);
    }

    /// <summary>
    ///   <para>Adds a command to set an input or output buffer parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="name">The name of the constant buffer in shader code.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="buffer">Buffer to set.</param>
    public void SetRayTracingBufferParam(
      RayTracingShader rayTracingShader,
      string name,
      ComputeBuffer buffer)
    {
      this.Internal_SetRayTracingBufferParam(rayTracingShader, Shader.PropertyToID(name), buffer);
    }

    /// <summary>
    ///   <para>Adds a command to set an input or output buffer parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="name">The name of the constant buffer in shader code.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="buffer">Buffer to set.</param>
    public void SetRayTracingBufferParam(
      RayTracingShader rayTracingShader,
      int nameID,
      ComputeBuffer buffer)
    {
      this.Internal_SetRayTracingBufferParam(rayTracingShader, nameID, buffer);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shader code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetRayTracingConstantBufferParam(
      RayTracingShader rayTracingShader,
      int nameID,
      ComputeBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetRayTracingConstantComputeBufferParam(rayTracingShader, nameID, buffer, offset, size);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shader code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetRayTracingConstantBufferParam(
      RayTracingShader rayTracingShader,
      string name,
      ComputeBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetRayTracingConstantComputeBufferParam(rayTracingShader, Shader.PropertyToID(name), buffer, offset, size);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shader code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetRayTracingConstantBufferParam(
      RayTracingShader rayTracingShader,
      int nameID,
      GraphicsBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetRayTracingConstantGraphicsBufferParam(rayTracingShader, nameID, buffer, offset, size);
    }

    /// <summary>
    ///   <para>Adds a command to set a constant buffer on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">The RayTracingShader to set parameter for.</param>
    /// <param name="nameID">The ID of the property name for the constant buffer in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="name">The name of the constant buffer in shader code.</param>
    /// <param name="buffer">The buffer to bind as constant buffer.</param>
    /// <param name="offset">The offset in bytes from the beginning of the buffer to bind. Must be a multiple of SystemInfo.constantBufferOffsetAlignment, or 0 if that value is 0.</param>
    /// <param name="size">The number of bytes to bind.</param>
    public void SetRayTracingConstantBufferParam(
      RayTracingShader rayTracingShader,
      string name,
      GraphicsBuffer buffer,
      int offset,
      int size)
    {
      this.Internal_SetRayTracingConstantGraphicsBufferParam(rayTracingShader, Shader.PropertyToID(name), buffer, offset, size);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">The ID of the property name for the texture in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    public void SetRayTracingTextureParam(
      RayTracingShader rayTracingShader,
      string name,
      RenderTargetIdentifier rt)
    {
      this.Internal_SetRayTracingTextureParam(rayTracingShader, Shader.PropertyToID(name), ref rt);
    }

    /// <summary>
    ///   <para>Adds a command to set a texture parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the texture variable in shader code.</param>
    /// <param name="nameID">The ID of the property name for the texture in shader code. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="rt">Texture value or identifier to set, see RenderTargetIdentifier.</param>
    public void SetRayTracingTextureParam(
      RayTracingShader rayTracingShader,
      int nameID,
      RenderTargetIdentifier rt)
    {
      this.Internal_SetRayTracingTextureParam(rayTracingShader, nameID, ref rt);
    }

    /// <summary>
    ///   <para>Adds a command to set a float parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingFloatParam(RayTracingShader rayTracingShader, string name, float val)
    {
      this.Internal_SetRayTracingFloatParam(rayTracingShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set a float parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingFloatParam(RayTracingShader rayTracingShader, int nameID, float val)
    {
      this.Internal_SetRayTracingFloatParam(rayTracingShader, nameID, val);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive float parameters on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetRayTracingFloatParams(
      RayTracingShader rayTracingShader,
      string name,
      params float[] values)
    {
      this.Internal_SetRayTracingFloats(rayTracingShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive float parameters on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetRayTracingFloatParams(
      RayTracingShader rayTracingShader,
      int nameID,
      params float[] values)
    {
      this.Internal_SetRayTracingFloats(rayTracingShader, nameID, values);
    }

    /// <summary>
    ///   <para>Adds a command to set an integer parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingIntParam(RayTracingShader rayTracingShader, string name, int val)
    {
      this.Internal_SetRayTracingIntParam(rayTracingShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set an integer parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingIntParam(RayTracingShader rayTracingShader, int nameID, int val)
    {
      this.Internal_SetRayTracingIntParam(rayTracingShader, nameID, val);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive integer parameters on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetRayTracingIntParams(
      RayTracingShader rayTracingShader,
      string name,
      params int[] values)
    {
      this.Internal_SetRayTracingInts(rayTracingShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set multiple consecutive integer parameters on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Values to set.</param>
    public void SetRayTracingIntParams(
      RayTracingShader rayTracingShader,
      int nameID,
      params int[] values)
    {
      this.Internal_SetRayTracingInts(rayTracingShader, nameID, values);
    }

    /// <summary>
    ///   <para>Adds a command to set a vector parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingVectorParam(
      RayTracingShader rayTracingShader,
      string name,
      Vector4 val)
    {
      this.Internal_SetRayTracingVectorParam(rayTracingShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set a vector parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingVectorParam(
      RayTracingShader rayTracingShader,
      int nameID,
      Vector4 val)
    {
      this.Internal_SetRayTracingVectorParam(rayTracingShader, nameID, val);
    }

    /// <summary>
    ///   <para>Adds a command to set a vector array parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Property name.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    public void SetRayTracingVectorArrayParam(
      RayTracingShader rayTracingShader,
      string name,
      params Vector4[] values)
    {
      this.Internal_SetRayTracingVectorArrayParam(rayTracingShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set a vector array parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Property name.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    public void SetRayTracingVectorArrayParam(
      RayTracingShader rayTracingShader,
      int nameID,
      params Vector4[] values)
    {
      this.Internal_SetRayTracingVectorArrayParam(rayTracingShader, nameID, values);
    }

    /// <summary>
    ///   <para>Adds a command to set a matrix parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingMatrixParam(
      RayTracingShader rayTracingShader,
      string name,
      Matrix4x4 val)
    {
      this.Internal_SetRayTracingMatrixParam(rayTracingShader, Shader.PropertyToID(name), val);
    }

    /// <summary>
    ///   <para>Adds a command to set a matrix parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="val">Value to set.</param>
    public void SetRayTracingMatrixParam(
      RayTracingShader rayTracingShader,
      int nameID,
      Matrix4x4 val)
    {
      this.Internal_SetRayTracingMatrixParam(rayTracingShader, nameID, val);
    }

    /// <summary>
    ///   <para>Adds a command to set a matrix array parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    public void SetRayTracingMatrixArrayParam(
      RayTracingShader rayTracingShader,
      string name,
      params Matrix4x4[] values)
    {
      this.Internal_SetRayTracingMatrixArrayParam(rayTracingShader, Shader.PropertyToID(name), values);
    }

    /// <summary>
    ///   <para>Adds a command to set a matrix array parameter on a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to set parameter for.</param>
    /// <param name="name">Name of the variable in shader code.</param>
    /// <param name="nameID">Property name ID. Use Shader.PropertyToID to get this ID.</param>
    /// <param name="values">Value to set.</param>
    public void SetRayTracingMatrixArrayParam(
      RayTracingShader rayTracingShader,
      int nameID,
      params Matrix4x4[] values)
    {
      this.Internal_SetRayTracingMatrixArrayParam(rayTracingShader, nameID, values);
    }

    /// <summary>
    ///   <para>Adds a command to execute a RayTracingShader.</para>
    /// </summary>
    /// <param name="rayTracingShader">RayTracingShader to execute.</param>
    /// <param name="rayGenName">The name of the ray generation shader.</param>
    /// <param name="width">The width of the ray generation shader thread grid.</param>
    /// <param name="height">The height of the ray generation shader thread grid.</param>
    /// <param name="depth">The depth of the ray generation shader thread grid.</param>
    /// <param name="camera">Optional parameter used to setup camera-related built-in shader variables.</param>
    public void DispatchRays(
      RayTracingShader rayTracingShader,
      string rayGenName,
      uint width,
      uint height,
      uint depth,
      Camera camera = null)
    {
      this.Internal_DispatchRays(rayTracingShader, rayGenName, width, height, depth, camera);
    }

    /// <summary>
    ///   <para>Generate mipmap levels of a render texture.</para>
    /// </summary>
    /// <param name="rt">The render texture requiring mipmaps generation.</param>
    public void GenerateMips(RenderTargetIdentifier rt)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_GenerateMips(rt);
    }

    /// <summary>
    ///   <para>Generate mipmap levels of a render texture.</para>
    /// </summary>
    /// <param name="rt">The render texture requiring mipmaps generation.</param>
    public void GenerateMips(RenderTexture rt)
    {
      if ((UnityEngine.Object) rt == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (rt));
      this.GenerateMips(new RenderTargetIdentifier((Texture) rt));
    }

    /// <summary>
    ///   <para>Force an antialiased render texture to be resolved.</para>
    /// </summary>
    /// <param name="rt">The antialiased render texture to resolve.</param>
    /// <param name="target">The render texture to resolve into.  If set, the target render texture must have the same dimensions and format as the source.</param>
    public void ResolveAntiAliasedSurface(RenderTexture rt, RenderTexture target = null)
    {
      if ((UnityEngine.Object) rt == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (rt));
      this.Internal_ResolveAntiAliasedSurface(rt, target);
    }

    /// <summary>
    ///   <para>Add a "draw mesh" command.</para>
    /// </summary>
    /// <param name="mesh">Mesh to draw.</param>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="submeshIndex">Which subset of the mesh to render.</param>
    /// <param name="shaderPass">Which pass of the shader to use (default is -1, which renders all passes).</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    public void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int submeshIndex,
      int shaderPass,
      MaterialPropertyBlock properties)
    {
      if ((UnityEngine.Object) mesh == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (mesh));
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
      {
        submeshIndex = Mathf.Clamp(submeshIndex, 0, mesh.subMeshCount - 1);
        Debug.LogWarning((object) string.Format("submeshIndex out of range. Clampped to {0}.", (object) submeshIndex));
      }
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      this.Internal_DrawMesh(mesh, matrix, material, submeshIndex, shaderPass, properties);
    }

    public void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int submeshIndex,
      int shaderPass)
    {
      this.DrawMesh(mesh, matrix, material, submeshIndex, shaderPass, (MaterialPropertyBlock) null);
    }

    public void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int submeshIndex)
    {
      this.DrawMesh(mesh, matrix, material, submeshIndex, -1);
    }

    public void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material)
    {
      this.DrawMesh(mesh, matrix, material, 0);
    }

    /// <summary>
    ///   <para>Add a "draw renderer" command.</para>
    /// </summary>
    /// <param name="renderer">Renderer to draw.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="submeshIndex">Which subset of the mesh to render.</param>
    /// <param name="shaderPass">Which pass of the shader to use (default is -1, which renders all passes).</param>
    public void DrawRenderer(
      Renderer renderer,
      Material material,
      int submeshIndex,
      int shaderPass)
    {
      if ((UnityEngine.Object) renderer == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (renderer));
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (submeshIndex < 0)
      {
        submeshIndex = Mathf.Max(submeshIndex, 0);
        Debug.LogWarning((object) string.Format("submeshIndex out of range. Clampped to {0}.", (object) submeshIndex));
      }
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      this.Internal_DrawRenderer(renderer, material, submeshIndex, shaderPass);
    }

    public void DrawRenderer(Renderer renderer, Material material, int submeshIndex)
    {
      this.DrawRenderer(renderer, material, submeshIndex, -1);
    }

    public void DrawRenderer(Renderer renderer, Material material)
    {
      this.DrawRenderer(renderer, material, 0);
    }

    /// <summary>
    ///   <para>Adds a "draw renderer list" command.</para>
    /// </summary>
    /// <param name="rendererList">The RendererList to draw.</param>
    public void DrawRendererList(RendererList rendererList)
    {
      this.Internal_DrawRendererList(rendererList);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="vertexCount">Vertex count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProcedural(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int vertexCount,
      int instanceCount,
      MaterialPropertyBlock properties)
    {
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_DrawProcedural(matrix, material, shaderPass, topology, vertexCount, instanceCount, properties);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="vertexCount">Vertex count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProcedural(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int vertexCount,
      int instanceCount)
    {
      this.DrawProcedural(matrix, material, shaderPass, topology, vertexCount, instanceCount, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="vertexCount">Vertex count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProcedural(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int vertexCount)
    {
      this.DrawProcedural(matrix, material, shaderPass, topology, vertexCount, 1);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexCount">Index count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="indexBuffer">The index buffer used to submit vertices to the GPU.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProcedural(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int indexCount,
      int instanceCount,
      MaterialPropertyBlock properties)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      this.Internal_DrawProceduralIndexed(indexBuffer, matrix, material, shaderPass, topology, indexCount, instanceCount, properties);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexCount">Index count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="indexBuffer">The index buffer used to submit vertices to the GPU.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProcedural(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int indexCount,
      int instanceCount)
    {
      this.DrawProcedural(indexBuffer, matrix, material, shaderPass, topology, indexCount, instanceCount, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexCount">Index count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="indexBuffer">The index buffer used to submit vertices to the GPU.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProcedural(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int indexCount)
    {
      this.DrawProcedural(indexBuffer, matrix, material, shaderPass, topology, indexCount, 1);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public void DrawProceduralIndirect(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_DrawProceduralIndirect(matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public void DrawProceduralIndirect(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset)
    {
      this.DrawProceduralIndirect(matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public void DrawProceduralIndirect(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs)
    {
      this.DrawProceduralIndirect(matrix, material, shaderPass, topology, bufferWithArgs, 0);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProceduralIndirect(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      this.Internal_DrawProceduralIndexedIndirect(indexBuffer, matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProceduralIndirect(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset)
    {
      this.DrawProceduralIndirect(indexBuffer, matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProceduralIndirect(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs)
    {
      this.DrawProceduralIndirect(indexBuffer, matrix, material, shaderPass, topology, bufferWithArgs, 0);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public void DrawProceduralIndirect(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_DrawProceduralIndirectGraphicsBuffer(matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public void DrawProceduralIndirect(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset)
    {
      this.DrawProceduralIndirect(matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public void DrawProceduralIndirect(
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs)
    {
      this.DrawProceduralIndirect(matrix, material, shaderPass, topology, bufferWithArgs, 0);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProceduralIndirect(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      this.Internal_DrawProceduralIndexedIndirectGraphicsBuffer(indexBuffer, matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, properties);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProceduralIndirect(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset)
    {
      this.DrawProceduralIndirect(indexBuffer, matrix, material, shaderPass, topology, bufferWithArgs, argsOffset, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw procedural geometry" command.</para>
    /// </summary>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="matrix">Transformation matrix to use.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use (or -1 for all passes).</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply just before rendering. See MaterialPropertyBlock.</param>
    public void DrawProceduralIndirect(
      GraphicsBuffer indexBuffer,
      Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs)
    {
      this.DrawProceduralIndirect(indexBuffer, matrix, material, shaderPass, topology, bufferWithArgs, 0);
    }

    /// <summary>
    ///         <para>Adds a "draw mesh with instancing" command.
    /// 
    /// The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive realtime shadows.
    /// 
    /// The command will not immediately fail and throw an exception if Material.enableInstancing is false, but it will log an error and skips rendering each time the command is being executed if such a condition is detected.
    /// 
    /// InvalidOperationException will be thrown if the current platform doesn't support this API (i.e. if GPU instancing is not available). See SystemInfo.supportsInstancing.</para>
    ///       </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="matrices">The array of object transformation matrices.</param>
    /// <param name="count">The number of instances to be drawn.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    public void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("DrawMeshInstanced is not supported.");
      if ((UnityEngine.Object) mesh == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (matrices == null)
        throw new ArgumentNullException(nameof (matrices));
      if (count < 0 || count > Mathf.Min(Graphics.kMaxDrawMeshInstanceCount, matrices.Length))
        throw new ArgumentOutOfRangeException(nameof (count), string.Format("Count must be in the range of 0 to {0}.", (object) Mathf.Min(Graphics.kMaxDrawMeshInstanceCount, matrices.Length)));
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (count <= 0)
        return;
      this.Internal_DrawMeshInstanced(mesh, submeshIndex, material, shaderPass, matrices, count, properties);
    }

    /// <summary>
    ///         <para>Adds a "draw mesh with instancing" command.
    /// 
    /// The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive realtime shadows.
    /// 
    /// The command will not immediately fail and throw an exception if Material.enableInstancing is false, but it will log an error and skips rendering each time the command is being executed if such a condition is detected.
    /// 
    /// InvalidOperationException will be thrown if the current platform doesn't support this API (i.e. if GPU instancing is not available). See SystemInfo.supportsInstancing.</para>
    ///       </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="matrices">The array of object transformation matrices.</param>
    /// <param name="count">The number of instances to be drawn.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    public void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      Matrix4x4[] matrices,
      int count)
    {
      this.DrawMeshInstanced(mesh, submeshIndex, material, shaderPass, matrices, count, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///         <para>Adds a "draw mesh with instancing" command.
    /// 
    /// The mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive realtime shadows.
    /// 
    /// The command will not immediately fail and throw an exception if Material.enableInstancing is false, but it will log an error and skips rendering each time the command is being executed if such a condition is detected.
    /// 
    /// InvalidOperationException will be thrown if the current platform doesn't support this API (i.e. if GPU instancing is not available). See SystemInfo.supportsInstancing.</para>
    ///       </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="matrices">The array of object transformation matrices.</param>
    /// <param name="count">The number of instances to be drawn.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    public void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      Matrix4x4[] matrices)
    {
      this.DrawMeshInstanced(mesh, submeshIndex, material, shaderPass, matrices, matrices.Length);
    }

    /// <summary>
    ///         <para>Add a "draw mesh with instancing" command.
    /// 
    /// Draw a mesh using Procedural Instancing. This is similar to Graphics.DrawMeshInstancedIndirect, except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer.
    /// If Material.enableInstancing is false, the command logs an error and skips rendering each time the command is executed; the command does not immediately fail and throw an exception.
    /// 
    /// InvalidOperationException will be thrown if the current platform doesn't support this API (for example, if GPU instancing is not available). See SystemInfo.supportsInstancing.</para>
    ///       </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="count">The number of instances to be drawn.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    public void DrawMeshInstancedProcedural(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      int count,
      MaterialPropertyBlock properties = null)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("DrawMeshInstancedProcedural is not supported.");
      if ((UnityEngine.Object) mesh == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (count <= 0)
        throw new ArgumentOutOfRangeException(nameof (count));
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      if (count <= 0)
        return;
      this.Internal_DrawMeshInstancedProcedural(mesh, submeshIndex, material, shaderPass, count, properties);
    }

    /// <summary>
    ///   <para>Add a "draw mesh with indirect instancing" command.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    public void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if ((UnityEngine.Object) mesh == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      this.Internal_DrawMeshInstancedIndirect(mesh, submeshIndex, material, shaderPass, bufferWithArgs, argsOffset, properties);
    }

    /// <summary>
    ///   <para>Add a "draw mesh with indirect instancing" command.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    public void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      ComputeBuffer bufferWithArgs,
      int argsOffset)
    {
      this.DrawMeshInstancedIndirect(mesh, submeshIndex, material, shaderPass, bufferWithArgs, argsOffset, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw mesh with indirect instancing" command.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    public void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      ComputeBuffer bufferWithArgs)
    {
      this.DrawMeshInstancedIndirect(mesh, submeshIndex, material, shaderPass, bufferWithArgs, 0, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw mesh with indirect instancing" command.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    public void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if ((UnityEngine.Object) mesh == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((UnityEngine.Object) material == (UnityEngine.Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      this.Internal_DrawMeshInstancedIndirectGraphicsBuffer(mesh, submeshIndex, material, shaderPass, bufferWithArgs, argsOffset, properties);
    }

    /// <summary>
    ///   <para>Add a "draw mesh with indirect instancing" command.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    public void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      GraphicsBuffer bufferWithArgs,
      int argsOffset)
    {
      this.DrawMeshInstancedIndirect(mesh, submeshIndex, material, shaderPass, bufferWithArgs, argsOffset, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Add a "draw mesh with indirect instancing" command.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This only applies to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="shaderPass">Which pass of the shader to use, or -1 which renders all passes.</param>
    /// <param name="properties">Additional Material properties to apply onto the Material just before this Mesh is drawn. See MaterialPropertyBlock.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    public void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      int shaderPass,
      GraphicsBuffer bufferWithArgs)
    {
      this.DrawMeshInstancedIndirect(mesh, submeshIndex, material, shaderPass, bufferWithArgs, 0, (MaterialPropertyBlock) null);
    }

    /// <summary>
    ///   <para>Adds a command onto the commandbuffer to draw the VR Device's occlusion mesh to the current render target.</para>
    /// </summary>
    /// <param name="normalizedCamViewport">The viewport of the camera currently being rendered.</param>
    public void DrawOcclusionMesh(RectInt normalizedCamViewport)
    {
      this.Internal_DrawOcclusionMesh(normalizedCamViewport);
    }

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="buffer">Buffer to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    /// <param name="rt">RenderTargetIdentifier to set as the write target.</param>
    public void SetRandomWriteTarget(int index, RenderTargetIdentifier rt)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.SetRandomWriteTarget_Texture(index, ref rt);
    }

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="buffer">Buffer to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    /// <param name="rt">RenderTargetIdentifier to set as the write target.</param>
    public void SetRandomWriteTarget(int index, ComputeBuffer buffer, bool preserveCounterValue)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.SetRandomWriteTarget_Buffer(index, buffer, preserveCounterValue);
    }

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="buffer">Buffer to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    /// <param name="rt">RenderTargetIdentifier to set as the write target.</param>
    public void SetRandomWriteTarget(int index, ComputeBuffer buffer)
    {
      this.SetRandomWriteTarget(index, buffer, false);
    }

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="buffer">Buffer to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    /// <param name="rt">RenderTargetIdentifier to set as the write target.</param>
    public void SetRandomWriteTarget(int index, GraphicsBuffer buffer, bool preserveCounterValue)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.SetRandomWriteTarget_GraphicsBuffer(index, buffer, preserveCounterValue);
    }

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="buffer">Buffer to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    /// <param name="rt">RenderTargetIdentifier to set as the write target.</param>
    public void SetRandomWriteTarget(int index, GraphicsBuffer buffer)
    {
      this.SetRandomWriteTarget(index, buffer, false);
    }

    /// <summary>
    ///   <para>Adds a command to copy ComputeBuffer or GraphicsBuffer counter value.</para>
    /// </summary>
    /// <param name="src">Append/consume buffer to copy the counter from.</param>
    /// <param name="dst">A buffer to copy the counter to.</param>
    /// <param name="dstOffsetBytes">Target byte offset in dst buffer.</param>
    public void CopyCounterValue(ComputeBuffer src, ComputeBuffer dst, uint dstOffsetBytes)
    {
      this.CopyCounterValueCC(src, dst, dstOffsetBytes);
    }

    /// <summary>
    ///   <para>Adds a command to copy ComputeBuffer or GraphicsBuffer counter value.</para>
    /// </summary>
    /// <param name="src">Append/consume buffer to copy the counter from.</param>
    /// <param name="dst">A buffer to copy the counter to.</param>
    /// <param name="dstOffsetBytes">Target byte offset in dst buffer.</param>
    public void CopyCounterValue(GraphicsBuffer src, ComputeBuffer dst, uint dstOffsetBytes)
    {
      this.CopyCounterValueGC(src, dst, dstOffsetBytes);
    }

    /// <summary>
    ///   <para>Adds a command to copy ComputeBuffer or GraphicsBuffer counter value.</para>
    /// </summary>
    /// <param name="src">Append/consume buffer to copy the counter from.</param>
    /// <param name="dst">A buffer to copy the counter to.</param>
    /// <param name="dstOffsetBytes">Target byte offset in dst buffer.</param>
    public void CopyCounterValue(ComputeBuffer src, GraphicsBuffer dst, uint dstOffsetBytes)
    {
      this.CopyCounterValueCG(src, dst, dstOffsetBytes);
    }

    /// <summary>
    ///   <para>Adds a command to copy ComputeBuffer or GraphicsBuffer counter value.</para>
    /// </summary>
    /// <param name="src">Append/consume buffer to copy the counter from.</param>
    /// <param name="dst">A buffer to copy the counter to.</param>
    /// <param name="dstOffsetBytes">Target byte offset in dst buffer.</param>
    public void CopyCounterValue(GraphicsBuffer src, GraphicsBuffer dst, uint dstOffsetBytes)
    {
      this.CopyCounterValueGG(src, dst, dstOffsetBytes);
    }

    /// <summary>
    ///   <para>Adds a command to copy pixel data from one texture to another.</para>
    /// </summary>
    /// <param name="src">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dst">The destination texture or RenderTargetIdentifier.</param>
    /// <param name="srcElement">The element in the source texture to copy from. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="srcMip">The mipmap level to copy from. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <param name="dstMip">The mipmap level to write to. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="srcX">The starting x coordinate of src to copy from. 0 is the left of the texture.</param>
    /// <param name="srcY">The starting y coordinate of src to copy from. 0 is the bottom of the texture.</param>
    /// <param name="srcWidth">The width of src to copy.</param>
    /// <param name="srcHeight">The height of src to copy.</param>
    /// <param name="dstX">The x coordinate of dst to copy to.</param>
    /// <param name="dstY">The y coordinate to dst to copy to.</param>
    public void CopyTexture(RenderTargetIdentifier src, RenderTargetIdentifier dst)
    {
      this.CopyTexture_Internal(ref src, -1, -1, -1, -1, -1, -1, ref dst, -1, -1, -1, -1, 1);
    }

    /// <summary>
    ///   <para>Adds a command to copy pixel data from one texture to another.</para>
    /// </summary>
    /// <param name="src">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dst">The destination texture or RenderTargetIdentifier.</param>
    /// <param name="srcElement">The element in the source texture to copy from. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="srcMip">The mipmap level to copy from. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <param name="dstMip">The mipmap level to write to. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="srcX">The starting x coordinate of src to copy from. 0 is the left of the texture.</param>
    /// <param name="srcY">The starting y coordinate of src to copy from. 0 is the bottom of the texture.</param>
    /// <param name="srcWidth">The width of src to copy.</param>
    /// <param name="srcHeight">The height of src to copy.</param>
    /// <param name="dstX">The x coordinate of dst to copy to.</param>
    /// <param name="dstY">The y coordinate to dst to copy to.</param>
    public void CopyTexture(
      RenderTargetIdentifier src,
      int srcElement,
      RenderTargetIdentifier dst,
      int dstElement)
    {
      this.CopyTexture_Internal(ref src, srcElement, -1, -1, -1, -1, -1, ref dst, dstElement, -1, -1, -1, 2);
    }

    /// <summary>
    ///   <para>Adds a command to copy pixel data from one texture to another.</para>
    /// </summary>
    /// <param name="src">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dst">The destination texture or RenderTargetIdentifier.</param>
    /// <param name="srcElement">The element in the source texture to copy from. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="srcMip">The mipmap level to copy from. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <param name="dstMip">The mipmap level to write to. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="srcX">The starting x coordinate of src to copy from. 0 is the left of the texture.</param>
    /// <param name="srcY">The starting y coordinate of src to copy from. 0 is the bottom of the texture.</param>
    /// <param name="srcWidth">The width of src to copy.</param>
    /// <param name="srcHeight">The height of src to copy.</param>
    /// <param name="dstX">The x coordinate of dst to copy to.</param>
    /// <param name="dstY">The y coordinate to dst to copy to.</param>
    public void CopyTexture(
      RenderTargetIdentifier src,
      int srcElement,
      int srcMip,
      RenderTargetIdentifier dst,
      int dstElement,
      int dstMip)
    {
      this.CopyTexture_Internal(ref src, srcElement, srcMip, -1, -1, -1, -1, ref dst, dstElement, dstMip, -1, -1, 3);
    }

    /// <summary>
    ///   <para>Adds a command to copy pixel data from one texture to another.</para>
    /// </summary>
    /// <param name="src">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dst">The destination texture or RenderTargetIdentifier.</param>
    /// <param name="srcElement">The element in the source texture to copy from. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="srcMip">The mipmap level to copy from. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <param name="dstMip">The mipmap level to write to. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="srcX">The starting x coordinate of src to copy from. 0 is the left of the texture.</param>
    /// <param name="srcY">The starting y coordinate of src to copy from. 0 is the bottom of the texture.</param>
    /// <param name="srcWidth">The width of src to copy.</param>
    /// <param name="srcHeight">The height of src to copy.</param>
    /// <param name="dstX">The x coordinate of dst to copy to.</param>
    /// <param name="dstY">The y coordinate to dst to copy to.</param>
    public void CopyTexture(
      RenderTargetIdentifier src,
      int srcElement,
      int srcMip,
      int srcX,
      int srcY,
      int srcWidth,
      int srcHeight,
      RenderTargetIdentifier dst,
      int dstElement,
      int dstMip,
      int dstX,
      int dstY)
    {
      this.CopyTexture_Internal(ref src, srcElement, srcMip, srcX, srcY, srcWidth, srcHeight, ref dst, dstElement, dstMip, dstX, dstY, 4);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(Texture source, RenderTargetIdentifier dest)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Texture(source, ref dest, (Material) null, -1, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(Texture source, RenderTargetIdentifier dest, Vector2 scale, Vector2 offset)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Texture(source, ref dest, (Material) null, -1, scale, offset, Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(Texture source, RenderTargetIdentifier dest, Material mat)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Texture(source, ref dest, mat, -1, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(Texture source, RenderTargetIdentifier dest, Material mat, int pass)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Texture(source, ref dest, mat, pass, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(RenderTargetIdentifier source, RenderTargetIdentifier dest)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Identifier(ref source, ref dest, (Material) null, -1, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(
      RenderTargetIdentifier source,
      RenderTargetIdentifier dest,
      Vector2 scale,
      Vector2 offset)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Identifier(ref source, ref dest, (Material) null, -1, scale, offset, Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(RenderTargetIdentifier source, RenderTargetIdentifier dest, Material mat)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Identifier(ref source, ref dest, mat, -1, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(
      RenderTargetIdentifier source,
      RenderTargetIdentifier dest,
      Material mat,
      int pass)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Identifier(ref source, ref dest, mat, pass, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), Texture2DArray.allSlices, 0);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(
      RenderTargetIdentifier source,
      RenderTargetIdentifier dest,
      int sourceDepthSlice,
      int destDepthSlice)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Identifier(ref source, ref dest, (Material) null, -1, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), sourceDepthSlice, destDepthSlice);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(
      RenderTargetIdentifier source,
      RenderTargetIdentifier dest,
      Vector2 scale,
      Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Identifier(ref source, ref dest, (Material) null, -1, scale, offset, sourceDepthSlice, destDepthSlice);
    }

    /// <summary>
    ///   <para>Adds a command to use a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture or RenderTargetIdentifier.</param>
    /// <param name="dest">The destination RenderTargetIdentifier.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public void Blit(
      RenderTargetIdentifier source,
      RenderTargetIdentifier dest,
      Material mat,
      int pass,
      int destDepthSlice)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Blit_Identifier(ref source, ref dest, mat, pass, new Vector2(1f, 1f), new Vector2(0.0f, 0.0f), Texture2DArray.allSlices, destDepthSlice);
    }

    /// <summary>
    ///   <para>Add a "set global shader float property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    public void SetGlobalFloat(string name, float value)
    {
      this.SetGlobalFloat(Shader.PropertyToID(name), value);
    }

    /// <summary>
    ///   <para>Adds a command to set the value of a given property for all Shaders, where the property has a type of Int in ShaderLab code.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    public void SetGlobalInt(string name, int value)
    {
      this.SetGlobalInt(Shader.PropertyToID(name), value);
    }

    /// <summary>
    ///   <para>Adds a command to set the value of a given property for all Shaders, where the property is an integer.</para>
    /// </summary>
    /// <param name="nameID"></param>
    /// <param name="value"></param>
    /// <param name="name"></param>
    public void SetGlobalInteger(string name, int value)
    {
      this.SetGlobalInteger(Shader.PropertyToID(name), value);
    }

    /// <summary>
    ///   <para>Add a "set global shader vector property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    public void SetGlobalVector(string name, Vector4 value)
    {
      this.SetGlobalVector(Shader.PropertyToID(name), value);
    }

    /// <summary>
    ///   <para>Add a "set global shader color property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    public void SetGlobalColor(string name, Color value)
    {
      this.SetGlobalColor(Shader.PropertyToID(name), value);
    }

    /// <summary>
    ///   <para>Add a "set global shader matrix property" command.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    public void SetGlobalMatrix(string name, Matrix4x4 value)
    {
      this.SetGlobalMatrix(Shader.PropertyToID(name), value);
    }

    public void SetGlobalFloatArray(string propertyName, List<float> values)
    {
      this.SetGlobalFloatArray(Shader.PropertyToID(propertyName), values);
    }

    public void SetGlobalFloatArray(int nameID, List<float> values)
    {
      if (values == null)
        throw new ArgumentNullException(nameof (values));
      if (values.Count == 0)
        throw new ArgumentException("Zero-sized array is not allowed.");
      this.SetGlobalFloatArrayListImpl(nameID, (object) values);
    }

    /// <summary>
    ///   <para>Add a "set global shader float array property" command.</para>
    /// </summary>
    /// <param name="propertyName"></param>
    /// <param name="values"></param>
    /// <param name="nameID"></param>
    public void SetGlobalFloatArray(string propertyName, float[] values)
    {
      this.SetGlobalFloatArray(Shader.PropertyToID(propertyName), values);
    }

    public void SetGlobalVectorArray(string propertyName, List<Vector4> values)
    {
      this.SetGlobalVectorArray(Shader.PropertyToID(propertyName), values);
    }

    public void SetGlobalVectorArray(int nameID, List<Vector4> values)
    {
      if (values == null)
        throw new ArgumentNullException(nameof (values));
      if (values.Count == 0)
        throw new ArgumentException("Zero-sized array is not allowed.");
      this.SetGlobalVectorArrayListImpl(nameID, (object) values);
    }

    /// <summary>
    ///   <para>Add a "set global shader vector array property" command.</para>
    /// </summary>
    /// <param name="propertyName"></param>
    /// <param name="values"></param>
    /// <param name="nameID"></param>
    public void SetGlobalVectorArray(string propertyName, Vector4[] values)
    {
      this.SetGlobalVectorArray(Shader.PropertyToID(propertyName), values);
    }

    public void SetGlobalMatrixArray(string propertyName, List<Matrix4x4> values)
    {
      this.SetGlobalMatrixArray(Shader.PropertyToID(propertyName), values);
    }

    public void SetGlobalMatrixArray(int nameID, List<Matrix4x4> values)
    {
      if (values == null)
        throw new ArgumentNullException(nameof (values));
      if (values.Count == 0)
        throw new ArgumentException("Zero-sized array is not allowed.");
      this.SetGlobalMatrixArrayListImpl(nameID, (object) values);
    }

    /// <summary>
    ///   <para>Add a "set global shader matrix array property" command.</para>
    /// </summary>
    /// <param name="propertyName"></param>
    /// <param name="values"></param>
    /// <param name="nameID"></param>
    public void SetGlobalMatrixArray(string propertyName, Matrix4x4[] values)
    {
      this.SetGlobalMatrixArray(Shader.PropertyToID(propertyName), values);
    }

    /// <summary>
    ///   <para>Add a "set global shader texture property" command, referencing a RenderTexture.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    /// <param name="element"></param>
    public void SetGlobalTexture(string name, RenderTargetIdentifier value)
    {
      this.SetGlobalTexture(Shader.PropertyToID(name), value, RenderTextureSubElement.Default);
    }

    /// <summary>
    ///   <para>Add a "set global shader texture property" command, referencing a RenderTexture.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    /// <param name="element"></param>
    public void SetGlobalTexture(int nameID, RenderTargetIdentifier value)
    {
      this.SetGlobalTexture_Impl(nameID, ref value, RenderTextureSubElement.Default);
    }

    /// <summary>
    ///   <para>Add a "set global shader texture property" command, referencing a RenderTexture.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    /// <param name="element"></param>
    public void SetGlobalTexture(
      string name,
      RenderTargetIdentifier value,
      RenderTextureSubElement element)
    {
      this.SetGlobalTexture(Shader.PropertyToID(name), value, element);
    }

    /// <summary>
    ///   <para>Add a "set global shader texture property" command, referencing a RenderTexture.</para>
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    /// <param name="nameID"></param>
    /// <param name="element"></param>
    public void SetGlobalTexture(
      int nameID,
      RenderTargetIdentifier value,
      RenderTextureSubElement element)
    {
      this.SetGlobalTexture_Impl(nameID, ref value, element);
    }

    /// <summary>
    ///   <para>Add a "set global shader buffer property" command.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the property retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the property.</param>
    /// <param name="value">The buffer to set.</param>
    public void SetGlobalBuffer(string name, ComputeBuffer value)
    {
      this.SetGlobalBufferInternal(Shader.PropertyToID(name), value);
    }

    /// <summary>
    ///   <para>Add a "set global shader buffer property" command.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the property retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the property.</param>
    /// <param name="value">The buffer to set.</param>
    public void SetGlobalBuffer(int nameID, ComputeBuffer value)
    {
      this.SetGlobalBufferInternal(nameID, value);
    }

    /// <summary>
    ///   <para>Add a "set global shader buffer property" command.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the property retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the property.</param>
    /// <param name="value">The buffer to set.</param>
    public void SetGlobalBuffer(string name, GraphicsBuffer value)
    {
      this.SetGlobalGraphicsBufferInternal(Shader.PropertyToID(name), value);
    }

    /// <summary>
    ///   <para>Add a "set global shader buffer property" command.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the property retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the property.</param>
    /// <param name="value">The buffer to set.</param>
    public void SetGlobalBuffer(int nameID, GraphicsBuffer value)
    {
      this.SetGlobalGraphicsBufferInternal(nameID, value);
    }

    /// <summary>
    ///   <para>Add a command to bind a global constant buffer.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the constant buffer retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the constant buffer to override.</param>
    /// <param name="buffer">The buffer to bind.</param>
    /// <param name="offset">Offset from the start of the buffer in bytes.</param>
    /// <param name="size">Size in bytes of the area to bind.</param>
    public void SetGlobalConstantBuffer(ComputeBuffer buffer, int nameID, int offset, int size)
    {
      this.SetGlobalConstantBufferInternal(buffer, nameID, offset, size);
    }

    /// <summary>
    ///   <para>Add a command to bind a global constant buffer.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the constant buffer retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the constant buffer to override.</param>
    /// <param name="buffer">The buffer to bind.</param>
    /// <param name="offset">Offset from the start of the buffer in bytes.</param>
    /// <param name="size">Size in bytes of the area to bind.</param>
    public void SetGlobalConstantBuffer(ComputeBuffer buffer, string name, int offset, int size)
    {
      this.SetGlobalConstantBufferInternal(buffer, Shader.PropertyToID(name), offset, size);
    }

    /// <summary>
    ///   <para>Add a command to bind a global constant buffer.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the constant buffer retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the constant buffer to override.</param>
    /// <param name="buffer">The buffer to bind.</param>
    /// <param name="offset">Offset from the start of the buffer in bytes.</param>
    /// <param name="size">Size in bytes of the area to bind.</param>
    public void SetGlobalConstantBuffer(GraphicsBuffer buffer, int nameID, int offset, int size)
    {
      this.SetGlobalConstantGraphicsBufferInternal(buffer, nameID, offset, size);
    }

    /// <summary>
    ///   <para>Add a command to bind a global constant buffer.</para>
    /// </summary>
    /// <param name="nameID">The name ID of the constant buffer retrieved by Shader.PropertyToID.</param>
    /// <param name="name">The name of the constant buffer to override.</param>
    /// <param name="buffer">The buffer to bind.</param>
    /// <param name="offset">Offset from the start of the buffer in bytes.</param>
    /// <param name="size">Size in bytes of the area to bind.</param>
    public void SetGlobalConstantBuffer(GraphicsBuffer buffer, string name, int offset, int size)
    {
      this.SetGlobalConstantGraphicsBufferInternal(buffer, Shader.PropertyToID(name), offset, size);
    }

    /// <summary>
    ///   <para>Add a "set shadow sampling mode" command.</para>
    /// </summary>
    /// <param name="shadowmap">Shadowmap render target to change the sampling mode on.</param>
    /// <param name="mode">New sampling mode.</param>
    public void SetShadowSamplingMode(RenderTargetIdentifier shadowmap, ShadowSamplingMode mode)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.SetShadowSamplingMode_Impl(ref shadowmap, mode);
    }

    public void SetSinglePassStereo(SinglePassStereoMode mode)
    {
      this.Internal_SetSinglePassStereo(mode);
    }

    /// <summary>
    ///   <para>Send a user-defined event to a native code plugin.</para>
    /// </summary>
    /// <param name="callback">Native code callback to queue for Unity's renderer to invoke.</param>
    /// <param name="eventID">User defined id to send to the callback.</param>
    public void IssuePluginEvent(IntPtr callback, int eventID)
    {
      if (callback == IntPtr.Zero)
        throw new ArgumentException("Null callback specified.");
      this.IssuePluginEventInternal(callback, eventID);
    }

    /// <summary>
    ///   <para>Send a user-defined event to a native code plugin with custom data.</para>
    /// </summary>
    /// <param name="callback">Native code callback to queue for Unity's renderer to invoke.</param>
    /// <param name="data">Custom data to pass to the native plugin callback.</param>
    /// <param name="eventID">Built in or user defined id to send to the callback.</param>
    public void IssuePluginEventAndData(IntPtr callback, int eventID, IntPtr data)
    {
      if (callback == IntPtr.Zero)
        throw new ArgumentException("Null callback specified.");
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.IssuePluginEventAndDataInternal(callback, eventID, data);
    }

    /// <summary>
    ///   <para>Send a user-defined blit event to a native code plugin.</para>
    /// </summary>
    /// <param name="callback">Native code callback to queue for Unity's renderer to invoke.</param>
    /// <param name="command">User defined command id to send to the callback.</param>
    /// <param name="source">Source render target.</param>
    /// <param name="dest">Destination render target.</param>
    /// <param name="commandParam">User data command parameters.</param>
    /// <param name="commandFlags">User data command flags.</param>
    public void IssuePluginCustomBlit(
      IntPtr callback,
      uint command,
      RenderTargetIdentifier source,
      RenderTargetIdentifier dest,
      uint commandParam,
      uint commandFlags)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.IssuePluginCustomBlitInternal(callback, command, ref source, ref dest, commandParam, commandFlags);
    }

    /// <summary>
    ///   <para>Deprecated. Use CommandBuffer.IssuePluginCustomTextureUpdateV2 instead.</para>
    /// </summary>
    /// <param name="callback">Native code callback to queue for Unity's renderer to invoke.</param>
    /// <param name="targetTexture">Texture resource to be updated.</param>
    /// <param name="userData">User data to send to the native plugin.</param>
    [Obsolete("Use IssuePluginCustomTextureUpdateV2 to register TextureUpdate callbacks instead. Callbacks will be passed event IDs kUnityRenderingExtEventUpdateTextureBeginV2 or kUnityRenderingExtEventUpdateTextureEndV2, and data parameter of type UnityRenderingExtTextureUpdateParamsV2.", false)]
    public void IssuePluginCustomTextureUpdate(
      IntPtr callback,
      Texture targetTexture,
      uint userData)
    {
      this.IssuePluginCustomTextureUpdateInternal(callback, targetTexture, userData, false);
    }

    /// <summary>
    ///   <para>Deprecated. Use CommandBuffer.IssuePluginCustomTextureUpdateV2 instead.</para>
    /// </summary>
    /// <param name="callback">Native code callback to queue for Unity's renderer to invoke.</param>
    /// <param name="targetTexture">Texture resource to be updated.</param>
    /// <param name="userData">User data to send to the native plugin.</param>
    [Obsolete("Use IssuePluginCustomTextureUpdateV2 to register TextureUpdate callbacks instead. Callbacks will be passed event IDs kUnityRenderingExtEventUpdateTextureBeginV2 or kUnityRenderingExtEventUpdateTextureEndV2, and data parameter of type UnityRenderingExtTextureUpdateParamsV2.", false)]
    public void IssuePluginCustomTextureUpdateV1(
      IntPtr callback,
      Texture targetTexture,
      uint userData)
    {
      this.IssuePluginCustomTextureUpdateInternal(callback, targetTexture, userData, false);
    }

    /// <summary>
    ///   <para>Send a texture update event to a native code plugin.</para>
    /// </summary>
    /// <param name="callback">Native code callback to queue for Unity's renderer to invoke.</param>
    /// <param name="targetTexture">Texture resource to be updated.</param>
    /// <param name="userData">User data to send to the native plugin.</param>
    public void IssuePluginCustomTextureUpdateV2(
      IntPtr callback,
      Texture targetTexture,
      uint userData)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.IssuePluginCustomTextureUpdateInternal(callback, targetTexture, userData, true);
    }

    public void ProcessVTFeedback(
      RenderTargetIdentifier rt,
      IntPtr resolver,
      int slice,
      int x,
      int width,
      int y,
      int height,
      int mip)
    {
      this.ValidateAgainstExecutionFlags(CommandBufferExecutionFlags.None, CommandBufferExecutionFlags.AsyncCompute);
      this.Internal_ProcessVTFeedback(rt, resolver, slice, x, width, y, height, mip);
    }

    /// <summary>
    ///   <para>Adds a command to copy the contents of one GraphicsBuffer into another.</para>
    /// </summary>
    /// <param name="source">The source buffer.</param>
    /// <param name="dest">The destination buffer.</param>
    public void CopyBuffer(GraphicsBuffer source, GraphicsBuffer dest)
    {
      Graphics.ValidateCopyBuffer(source, dest);
      this.CopyBufferImpl(source, dest);
    }

    /// <summary>
    ///   <para>This functionality is deprecated, and should no longer be used. Please use CommandBuffer.CreateGraphicsFence.</para>
    /// </summary>
    /// <param name="stage"></param>
    [Obsolete("CommandBuffer.CreateGPUFence has been deprecated. Use CreateGraphicsFence instead (UnityUpgradable) -> CreateAsyncGraphicsFence(*)", false)]
    public GPUFence CreateGPUFence(SynchronisationStage stage) => new GPUFence();

    [Obsolete("CommandBuffer.CreateGPUFence has been deprecated. Use CreateGraphicsFence instead (UnityUpgradable) -> CreateAsyncGraphicsFence()", false)]
    public GPUFence CreateGPUFence() => new GPUFence();

    /// <summary>
    ///   <para>This functionality is deprecated, and should no longer be used. Please use CommandBuffer.WaitOnAsyncGraphicsFence.</para>
    /// </summary>
    /// <param name="fence">The GPUFence that the GPU will be instructed to wait upon.</param>
    /// <param name="stage">On some platforms there is a significant gap between the vertex processing completing and the pixel processing completing for a given draw call. This parameter allows for requested wait to be before the next items vertex or pixel processing begins. Some platforms can not differentiate between the start of vertex and pixel processing, these platforms will wait before the next items vertex processing. If a compute shader dispatch is the next item to be submitted then this parameter is ignored.</param>
    [Obsolete("CommandBuffer.WaitOnGPUFence has been deprecated. Use WaitOnGraphicsFence instead (UnityUpgradable) -> WaitOnAsyncGraphicsFence(*)", false)]
    public void WaitOnGPUFence(GPUFence fence, SynchronisationStage stage)
    {
    }

    [Obsolete("CommandBuffer.WaitOnGPUFence has been deprecated. Use WaitOnGraphicsFence instead (UnityUpgradable) -> WaitOnAsyncGraphicsFence(*)", false)]
    public void WaitOnGPUFence(GPUFence fence)
    {
    }

    [Obsolete("CommandBuffer.SetComputeBufferData has been deprecated. Use SetBufferData instead (UnityUpgradable) -> SetBufferData(*)", false)]
    public void SetComputeBufferData(ComputeBuffer buffer, Array data)
    {
      this.SetBufferData(buffer, data);
    }

    [Obsolete("CommandBuffer.SetComputeBufferData has been deprecated. Use SetBufferData instead (UnityUpgradable) -> SetBufferData(*)", false)]
    public void SetComputeBufferData<T>(ComputeBuffer buffer, List<T> data) where T : struct
    {
      this.SetBufferData<T>(buffer, data);
    }

    [Obsolete("CommandBuffer.SetComputeBufferData has been deprecated. Use SetBufferData instead (UnityUpgradable) -> SetBufferData(*)", false)]
    public void SetComputeBufferData<T>(ComputeBuffer buffer, NativeArray<T> data) where T : struct
    {
      this.SetBufferData<T>(buffer, data);
    }

    [Obsolete("CommandBuffer.SetComputeBufferData has been deprecated. Use SetBufferData instead (UnityUpgradable) -> SetBufferData(*)", false)]
    public void SetComputeBufferData(
      ComputeBuffer buffer,
      Array data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
    {
      this.SetBufferData(buffer, data, managedBufferStartIndex, graphicsBufferStartIndex, count);
    }

    [Obsolete("CommandBuffer.SetComputeBufferData has been deprecated. Use SetBufferData instead (UnityUpgradable) -> SetBufferData(*)", false)]
    public void SetComputeBufferData<T>(
      ComputeBuffer buffer,
      List<T> data,
      int managedBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
      where T : struct
    {
      this.SetBufferData<T>(buffer, data, managedBufferStartIndex, graphicsBufferStartIndex, count);
    }

    [Obsolete("CommandBuffer.SetComputeBufferData has been deprecated. Use SetBufferData instead (UnityUpgradable) -> SetBufferData(*)", false)]
    public void SetComputeBufferData<T>(
      ComputeBuffer buffer,
      NativeArray<T> data,
      int nativeBufferStartIndex,
      int graphicsBufferStartIndex,
      int count)
      where T : struct
    {
      this.SetBufferData<T>(buffer, data, nativeBufferStartIndex, graphicsBufferStartIndex, count);
    }

    [Obsolete("CommandBuffer.SetComputeBufferCounterValue has been deprecated. Use SetBufferCounterValue instead (UnityUpgradable) -> SetBufferCounterValue(*)", false)]
    public void SetComputeBufferCounterValue(ComputeBuffer buffer, uint counterValue)
    {
      this.SetBufferCounterValue(buffer, counterValue);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void ConvertTexture_Internal_Injected(
      ref RenderTargetIdentifier src,
      int srcElement,
      ref RenderTargetIdentifier dst,
      int dstElement);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetComputeVectorParam_Injected(
      ComputeShader computeShader,
      int nameID,
      ref Vector4 val);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetComputeMatrixParam_Injected(
      ComputeShader computeShader,
      int nameID,
      ref Matrix4x4 val);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingVectorParam_Injected(
      RayTracingShader rayTracingShader,
      int nameID,
      ref Vector4 val);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_SetRayTracingMatrixParam_Injected(
      RayTracingShader rayTracingShader,
      int nameID,
      ref Matrix4x4 val);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_BuildRayTracingAccelerationStructure_Injected(
      RayTracingAccelerationStructure accelerationStructure,
      ref Vector3 relativeOrigin);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_GenerateMips_Injected(ref RenderTargetIdentifier rt);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawMesh_Injected(
      Mesh mesh,
      ref Matrix4x4 matrix,
      Material material,
      int submeshIndex,
      int shaderPass,
      MaterialPropertyBlock properties);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawRendererList_Injected(ref RendererList rendererList);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawProcedural_Injected(
      ref Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int vertexCount,
      int instanceCount,
      MaterialPropertyBlock properties);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawProceduralIndexed_Injected(
      GraphicsBuffer indexBuffer,
      ref Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      int indexCount,
      int instanceCount,
      MaterialPropertyBlock properties);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawProceduralIndirect_Injected(
      ref Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawProceduralIndexedIndirect_Injected(
      GraphicsBuffer indexBuffer,
      ref Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawProceduralIndirectGraphicsBuffer_Injected(
      ref Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawProceduralIndexedIndirectGraphicsBuffer_Injected(
      GraphicsBuffer indexBuffer,
      ref Matrix4x4 matrix,
      Material material,
      int shaderPass,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_DrawOcclusionMesh_Injected(ref RectInt normalizedCamViewport);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetViewport_Injected(ref Rect pixelRect);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void EnableScissorRect_Injected(ref Rect scissor);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Blit_Texture_Injected(
      Texture source,
      ref RenderTargetIdentifier dest,
      Material mat,
      int pass,
      ref Vector2 scale,
      ref Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Blit_Identifier_Injected(
      ref RenderTargetIdentifier source,
      ref RenderTargetIdentifier dest,
      Material mat,
      int pass,
      ref Vector2 scale,
      ref Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void GetTemporaryRTWithDescriptor_Injected(
      int nameID,
      ref RenderTextureDescriptor desc,
      FilterMode filter);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void ClearRenderTarget_Injected(
      RTClearFlags clearFlags,
      ref Color backgroundColor,
      float depth,
      uint stencil);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalVector_Injected(int nameID, ref Vector4 value);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalColor_Injected(int nameID, ref Color value);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalMatrix_Injected(int nameID, ref Matrix4x4 value);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void EnableGlobalKeyword_Injected(ref GlobalKeyword keyword);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void EnableMaterialKeyword_Injected(Material material, ref LocalKeyword keyword);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void EnableComputeKeyword_Injected(
      ComputeShader computeShader,
      ref LocalKeyword keyword);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void DisableGlobalKeyword_Injected(ref GlobalKeyword keyword);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void DisableMaterialKeyword_Injected(Material material, ref LocalKeyword keyword);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void DisableComputeKeyword_Injected(
      ComputeShader computeShader,
      ref LocalKeyword keyword);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetGlobalKeyword_Injected(ref GlobalKeyword keyword, bool value);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetMaterialKeyword_Injected(
      Material material,
      ref LocalKeyword keyword,
      bool value);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetComputeKeyword_Injected(
      ComputeShader computeShader,
      ref LocalKeyword keyword,
      bool value);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetViewMatrix_Injected(ref Matrix4x4 view);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetProjectionMatrix_Injected(ref Matrix4x4 proj);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetViewProjectionMatrices_Injected(ref Matrix4x4 view, ref Matrix4x4 proj);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void IncrementUpdateCount_Injected(ref RenderTargetIdentifier dest);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRenderTargetSingle_Internal_Injected(
      ref RenderTargetIdentifier rt,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRenderTargetColorDepth_Internal_Injected(
      ref RenderTargetIdentifier color,
      ref RenderTargetIdentifier depth,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      RenderTargetFlags flags);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRenderTargetMulti_Internal_Injected(
      RenderTargetIdentifier[] colors,
      ref RenderTargetIdentifier depth,
      RenderBufferLoadAction[] colorLoadActions,
      RenderBufferStoreAction[] colorStoreActions,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      RenderTargetFlags flags);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRenderTargetColorDepthSubtarget_Injected(
      ref RenderTargetIdentifier color,
      ref RenderTargetIdentifier depth,
      RenderBufferLoadAction colorLoadAction,
      RenderBufferStoreAction colorStoreAction,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void SetRenderTargetMultiSubtarget_Injected(
      RenderTargetIdentifier[] colors,
      ref RenderTargetIdentifier depth,
      RenderBufferLoadAction[] colorLoadActions,
      RenderBufferStoreAction[] colorStoreActions,
      RenderBufferLoadAction depthLoadAction,
      RenderBufferStoreAction depthStoreAction,
      int mipLevel,
      CubemapFace cubemapFace,
      int depthSlice);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private extern void Internal_ProcessVTFeedback_Injected(
      ref RenderTargetIdentifier rt,
      IntPtr resolver,
      int slice,
      int x,
      int width,
      int y,
      int height,
      int mip);
  }
}
